[][src]Struct susyp2p_core::nodes::handled_node_tasks::Task

pub struct Task<'a, TInEvent, TUserData> { /* fields omitted */ }

Access to a task in the collection.

Methods

impl<'a, TInEvent, TUserData> Task<'a, TInEvent, TUserData>[src]

pub fn send_event(&mut self, event: TInEvent)[src]

Sends an event to the given node.

pub fn user_data(&self) -> &TUserData[src]

Returns the user data associated with the task.

pub fn user_data_mut(&mut self) -> &mut TUserData[src]

Returns the user data associated with the task.

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

Returns the task id.

pub fn close(self) -> ClosedTask<TInEvent, TUserData>[src]

Closes the task. Returns the user data.

No further event will be generated for this task, but the connection inside the task will continue to run until the ClosedTask is destroyed.

pub fn take_over(&mut self, other: ClosedTask<TInEvent, TUserData>) -> TUserData[src]

Gives ownership of a closed task. As soon as our task (self) has some acknowledgment from the remote that its connection is alive, it will close the connection with other.

Trait Implementations

impl<'a, TInEvent, TUserData> Debug for Task<'a, TInEvent, TUserData> where
    TUserData: Debug
[src]

Auto Trait Implementations

impl<'a, TInEvent, TUserData> Send for Task<'a, TInEvent, TUserData> where
    TInEvent: Send,
    TUserData: Send

impl<'a, TInEvent, TUserData> Sync for Task<'a, TInEvent, TUserData> where
    TInEvent: Send,
    TUserData: Sync

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T