Struct heph_inbox::Sender [−][src]
pub struct Sender<T> { /* fields omitted */ }
Expand description
Sending side of the channel.
Implementations
impl<T> Sender<T>
[src]
impl<T> Sender<T>
[src]pub fn try_send(&self, value: T) -> Result<(), SendError<T>>
[src]
pub fn try_send(&self, value: T) -> Result<(), SendError<T>>
[src]Attempts to send the value
into the channel.
pub fn send<'s>(&'s self, value: T) -> SendValue<'s, T>ⓘ
[src]
pub fn send<'s>(&'s self, value: T) -> SendValue<'s, T>ⓘ
[src]Returns a future that sends a value into the channel, waiting if the channel is full.
If the returned Future
returns an error it means the Receiver
and Manager
are disconnected and no more values will be read from
the channel. This is the same error as SendError::Disconnected
.
SendError::Full
will never be returned, the Future
will return
Poll::Pending
instead.
pub fn join<'s>(&'s self) -> Join<'s, T>ⓘ
[src]
pub fn join<'s>(&'s self) -> Join<'s, T>ⓘ
[src]Returns a Future
that waits until the other side of the channel is
disconnected.
pub fn is_connected(&self) -> bool
[src]
pub fn is_connected(&self) -> bool
[src]Returns true
if the Receiver
and or the Manager
are connected.
Notes
Unlike Receiver::is_connected
this method takes the Manager
into
account. This is done to support the use case in which an actor is
restarted and a new receiver is created for it.
pub fn has_manager(&self) -> bool
[src]
pub fn has_manager(&self) -> bool
[src]Returns true
if the Manager
is connected.
pub fn same_channel(&self, other: &Sender<T>) -> bool
[src]
pub fn same_channel(&self, other: &Sender<T>) -> bool
[src]Returns true
if senders send into the same channel.
Trait Implementations
impl<T> Clone for Sender<T>
[src]
impl<T> Clone for Sender<T>
[src]Safety
Only 2 ^ 30
(a billion) Sender
s may be alive concurrently, more then
enough for all practical use cases.
impl<T: Send> Send for Sender<T>
[src]
impl<T> Sync for Sender<T>
[src]
impl<T> Unpin for Sender<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Sender<T>
impl<T> !UnwindSafe for Sender<T>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more