Struct telecomande::Remote
source · [−]pub struct Remote<P> where
P: Processor, { /* private fields */ }
Expand description
Represents a shareable/clonable remote to a task running a crate::Processor
.
Used to send crate::Command
to that task.
Initially constructed by the crate::Handle
returned on the crate::Executor::spawn
of the task.
Implementations
sourceimpl<P> Remote<P> where
P: Processor,
impl<P> Remote<P> where
P: Processor,
pub fn new(sender: UnboundedSender<P::Command>) -> Self
sourcepub fn send(&self, command: P::Command) -> Result<(), SendError<P::Command>>
pub fn send(&self, command: P::Command) -> Result<(), SendError<P::Command>>
Sends a crate::Command
to the running crate::Processor
for it to handle.
sourcepub fn remote(&self) -> Self
pub fn remote(&self) -> Self
Returns a crate::Remote
able to send crate::Command
to the crate::Processor
of the running task.
Trait Implementations
Auto Trait Implementations
impl<P> !RefUnwindSafe for Remote<P>
impl<P> Send for Remote<P>
impl<P> Sync for Remote<P>
impl<P> Unpin for Remote<P>
impl<P> !UnwindSafe for Remote<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