Struct safina_sync::SyncSender
source · [−]pub struct SyncSender<T: Send> { /* private fields */ }
Implementations
sourceimpl<T: Send + Clone> SyncSender<T>
impl<T: Send + Clone> SyncSender<T>
sourcepub async fn async_send(&self, value: T) -> Result<(), SendError<T>>
pub async fn async_send(&self, value: T) -> Result<(), SendError<T>>
Sends a value on this synchronous channel.
This function will block until space in the internal buffer becomes available or a receiver is available to hand off the message to.
Note that a successful send does not guarantee that the receiver will ever see the data. Items may be enqueued in the internal buffer for the receiver to receive at a later time.
Errors
This function will never panic, but it may return Err if the Receiver has disconnected and is no longer able to receive information.
sourceimpl<T: Send> SyncSender<T>
impl<T: Send> SyncSender<T>
sourcepub fn send(&self, value: T) -> Result<(), SendError<T>>
pub fn send(&self, value: T) -> Result<(), SendError<T>>
Sends a value on this synchronous channel.
This function will block until space in the internal buffer becomes available or a receiver is available to hand off the message to.
Note that a successful send does not guarantee that the receiver will ever see the data. Items may be enqueued in the internal buffer for the receiver to receive at a later time.
Errors
This function will never panic, but it may return Err if the Receiver has disconnected and is no longer able to receive information.
sourcepub fn try_send(&self, value: T) -> Result<(), TrySendError<T>>
pub fn try_send(&self, value: T) -> Result<(), TrySendError<T>>
Attempts to send a value on this channel. Returns immediately.
Errors
Returns TrySendError::Full
when the channel’s buffer is full.
Returns TrySendError::Disconnected
when the channel’s receiver has been dropped.
Trait Implementations
sourceimpl<T: Clone + Send> Clone for SyncSender<T>
impl<T: Clone + Send> Clone for SyncSender<T>
sourcefn clone(&self) -> SyncSender<T>
fn clone(&self) -> SyncSender<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Send> Debug for SyncSender<T>
impl<T: Send> Debug for SyncSender<T>
sourceimpl<T: Send> Drop for SyncSender<T>
impl<T: Send> Drop for SyncSender<T>
sourceimpl<T: Send> PartialEq<SyncSender<T>> for SyncSender<T>
impl<T: Send> PartialEq<SyncSender<T>> for SyncSender<T>
impl<T: Send> Eq for SyncSender<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for SyncSender<T>
impl<T> Send for SyncSender<T>
impl<T> Sync for SyncSender<T>
impl<T> Unpin for SyncSender<T>
impl<T> UnwindSafe for SyncSender<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more