Struct heph_inbox::Sender[][src]

pub struct Sender<T> { /* fields omitted */ }

Sending side of the channel.

Implementations

impl<T> Sender<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>

Notable traits for SendValue<'s, T>

impl<'s, T> Future for SendValue<'s, T> type Output = Result<(), 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 capacity(&self) -> usize[src]

Returns the capacity of the channel.

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]

Returns true if the Manager is connected.

pub fn same_channel(&self, other: &Sender<T>) -> bool[src]

Returns true if senders send into the same channel.

pub fn sends_to(&self, receiver: &Receiver<T>) -> bool[src]

Returns true if this sender sends to the receiver.

pub fn id(&self) -> Id[src]

Returns the id of this sender.

Trait Implementations

impl<T> Clone for Sender<T>[src]

Safety

Only 2 ^ 30 (a billion) Senders may be alive concurrently, more then enough for all practical use cases.

impl<T> Debug for Sender<T>[src]

impl<T> Drop for Sender<T>[src]

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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.