[][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)[src]

Begin sending an event to the given node. Must be called only after a successful call to poll_ready_event.

pub fn poll_ready_event(&mut self, cx: &mut Context) -> Poll<()>[src]

Make sure we are ready to accept an event to be sent 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.

pub fn start_take_over(&mut self, 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.

Must be called only after a successful call to poll_ready_take_over.

pub fn poll_ready_take_over(&mut self, cx: &mut Context) -> Poll<()>[src]

Make sure we are ready to taking over with start_take_over.

Trait Implementations

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

Auto Trait Implementations

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

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

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

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

impl<'a, E, T> !UnwindSafe for TaskEntry<'a, E, 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> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,