Struct ockam_node::Cancel[][src]

pub struct Cancel<'ctx, M: Message> { /* fields omitted */ }
Expand description

A message wraper type that allows users to cancel message receival

A worker can block in place to wait for a message. If the next message is not the desired type, it can be cancelled which re-queues it into the mailbox.

Implementations

impl<'ctx, M: Message> Cancel<'ctx, M>[src]

pub async fn cancel(self)[src]

Cancel this message

pub fn take(self) -> Routed<M>[src]

Consume the Cancel wrapper to take the underlying message

After calling this function it is no longer possible to re-queue the message into the worker mailbox.

Trait Implementations

impl<'ctx, M: Message + Debug> Debug for Cancel<'ctx, M>[src]

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

Formats the value using the given formatter. Read more

impl<'ctx, M: Message> Deref for Cancel<'ctx, M>[src]

type Target = M

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl<'ctx, M: Message + Display> Display for Cancel<'ctx, M>[src]

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

Formats the value using the given formatter. Read more

impl<'ctx, M: Message + PartialEq> PartialEq<M> for Cancel<'ctx, M>[src]

fn eq(&self, o: &M) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

Auto Trait Implementations

impl<'ctx, M> !RefUnwindSafe for Cancel<'ctx, M>

impl<'ctx, M> Send for Cancel<'ctx, M>

impl<'ctx, M> Sync for Cancel<'ctx, M> where
    M: Sync

impl<'ctx, M> Unpin for Cancel<'ctx, M> where
    M: Unpin

impl<'ctx, M> !UnwindSafe for Cancel<'ctx, M>

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> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

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

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V