[][src]Struct libp2p_core::nodes::tasks::TaskEntry

pub struct TaskEntry<'a, E, T> { /* fields omitted */ }

Access to a task in the collection.

Methods

impl<'a, E, T> TaskEntry<'a, E, T>[src]

pub fn start_send_event(&mut self, event: E) -> StartSend<E, ()>[src]

Begin sending an event to the given node.

Make sure to finish the send operation with complete_send_event.

pub fn complete_send_event(&mut self) -> Poll<(), ()>[src]

Finish a send operation started with start_send_event.

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

Returns the user data associated with the task.

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

Returns the user data associated with the task.

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

Returns the task id.

pub fn close(self) -> ClosedTask<E, T>[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.

#[must_use] pub fn start_take_over(
    &mut self,
    t: ClosedTask<E, T>
) -> StartTakeOver<T, ClosedTask<E, T>>
[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.

Make sure to complete this operation with complete_take_over.

pub fn complete_take_over(&mut self) -> Poll<(), ()>[src]

Finish take over started by start_take_over.

Trait Implementations

impl<'_, E, T: Debug> Debug for TaskEntry<'_, E, T>[src]

Auto Trait Implementations

impl<'a, E, T> Unpin for TaskEntry<'a, E, T> where
    E: Unpin,
    T: Unpin

impl<'a, E, T> Sync for TaskEntry<'a, E, T> where
    E: Send + Sync,
    T: Sync

impl<'a, E, T> Send for TaskEntry<'a, E, T> where
    E: Send,
    T: Send

impl<'a, E, T> !RefUnwindSafe for TaskEntry<'a, E, T>

impl<'a, E, T> !UnwindSafe for TaskEntry<'a, E, T>

Blanket Implementations

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

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

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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self