[−][src]Struct libp2p_core::nodes::tasks::TaskEntry
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]
&mut self,
t: ClosedTask<E, T>
) -> StartTakeOver<T, ClosedTask<E, T>>
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
Auto Trait Implementations
impl<'a, E, T> Unpin for TaskEntry<'a, E, T> where
E: Unpin,
T: Unpin,
E: Unpin,
T: Unpin,
impl<'a, E, T> Sync for TaskEntry<'a, E, T> where
E: Send + Sync,
T: Sync,
E: Send + Sync,
T: Sync,
impl<'a, E, T> Send for TaskEntry<'a, E, T> where
E: Send,
T: Send,
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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self