Struct re_smart_channel::Sender
source · pub struct Sender<T: Send> { /* private fields */ }Implementations§
source§impl<T: Send> Sender<T>
impl<T: Send> Sender<T>
sourcepub fn clone_as(&self, source: SmartMessageSource) -> Self
pub fn clone_as(&self, source: SmartMessageSource) -> Self
Clones the sender with an updated source.
pub fn send(&self, msg: T) -> Result<(), SendError<T>>
sourcepub fn send_at(
&self,
time: Instant,
source: Arc<SmartMessageSource>,
payload: SmartMessagePayload<T>
) -> Result<(), SendError<SmartMessagePayload<T>>>
pub fn send_at( &self, time: Instant, source: Arc<SmartMessageSource>, payload: SmartMessagePayload<T> ) -> Result<(), SendError<SmartMessagePayload<T>>>
Forwards a message as-is.
sourcepub fn flush_blocking(&self) -> Result<(), SendError<()>>
pub fn flush_blocking(&self) -> Result<(), SendError<()>>
Blocks until all previously sent messages have been received.
Note: This is only implemented for non-wasm targets since we cannot make blocking calls on web.
sourcepub fn quit(
&self,
err: Option<Box<dyn Error + Send>>
) -> Result<(), SendError<SmartMessage<T>>>
pub fn quit( &self, err: Option<Box<dyn Error + Send>> ) -> Result<(), SendError<SmartMessage<T>>>
Used to indicate that a sender has left.
This sends a message down the channel allowing the receiving end to know whether one of the sender has left, and if so why (if applicable).
Using a Sender after calling quit is undefined behavior: the receiving end is free
to silently drop those messages (or worse).
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
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T>
impl<T> Sync for Sender<T>
impl<T> Unpin for Sender<T>
impl<T> UnwindSafe for Sender<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