Struct re_smart_channel::Receiver
source · pub struct Receiver<T: Send> { /* private fields */ }
Implementations§
source§impl<T: Send> Receiver<T>
impl<T: Send> Receiver<T>
sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Are we still connected?
Once false, we will never be connected again: the source has run dry.
This is only updated once one of the receive methods fails.
pub fn recv(&self) -> Result<SmartMessage<T>, RecvError>
pub fn try_recv(&self) -> Result<SmartMessage<T>, TryRecvError>
pub fn recv_timeout( &self, timeout: Duration ) -> Result<SmartMessage<T>, RecvTimeoutError>
sourcepub fn recv_with_send_time(&self) -> Result<SmartMessage<T>, RecvError>
pub fn recv_with_send_time(&self) -> Result<SmartMessage<T>, RecvError>
Receives without registering the latency.
This is for use with crate::Sender::send_at
when chaining to another channel
created with Self::chained_channel
.
sourcepub fn source(&self) -> &SmartChannelSource
pub fn source(&self) -> &SmartChannelSource
Where is the data coming from?
sourcepub fn latency_ns(&self) -> u64
pub fn latency_ns(&self) -> u64
Latest known latency from sending a message to receiving it, it nanoseconds.
sourcepub fn latency_sec(&self) -> f32
pub fn latency_sec(&self) -> f32
Latest known latency from sending a message to receiving it, in seconds
sourcepub fn chained_channel(&self) -> (Sender<T>, Receiver<T>)
pub fn chained_channel(&self) -> (Sender<T>, Receiver<T>)
Create a new channel that use the same stats as this one.
This means both channels will see the same latency numbers.
Care must be taken to use Self::recv_with_send_time
and crate::Sender::send_at
.
This is a very leaky abstraction, and it would be nice with a refactor.
Auto Trait Implementations§
impl<T> !Freeze for Receiver<T>
impl<T> RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T>
impl<T> Sync for Receiver<T>
impl<T> Unpin for Receiver<T>where
T: Unpin,
impl<T> UnwindSafe for Receiver<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more