Struct telecomande::Handle
source · [−]pub struct Handle<P> where
P: Processor, { /* private fields */ }
Expand description
A handle to a task running a crate::Processor
.
- Warning: the manager stops operating if this is dropped.
Permit the creation of
crate::Remote
.
Implementations
sourceimpl<P> Handle<P> where
P: Processor,
impl<P> Handle<P> where
P: Processor,
pub fn new(
task: JoinHandle<P::Error>,
sender: UnboundedSender<P::Command>
) -> Self
sourcepub async fn join(self) -> Result<P::Error, JoinError>
pub async fn join(self) -> Result<P::Error, JoinError>
Will wait -possibly endlessly- for the task to finish. Prevents the task from being dropped before the current thread.
pub fn abort(self)
sourcepub fn remote(&self) -> Remote<P>
pub fn remote(&self) -> Remote<P>
Returns a crate::Remote
able to send crate::Command
to the crate::Processor
of the running task.
Auto Trait Implementations
impl<P> !RefUnwindSafe for Handle<P>
impl<P> Send for Handle<P>
impl<P> Sync for Handle<P>
impl<P> Unpin for Handle<P>
impl<P> !UnwindSafe for Handle<P>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more