Struct heph_inbox::Sender[][src]

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

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 join<'s>(&'s self) -> Join<'s, T>

Notable traits for Join<'s, T>

impl<'s, T> Future for Join<'s, T> type Output = ();
[src]

Returns a Future that waits until the other side of the channel is disconnected.

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.

fn clone(&self) -> Sender<T>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

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

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

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]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.