Struct appliance::ApplianceHandle [−][src]
Appliance handle is a cloneable object which allows to send messages to the appliance.
Once all handles to the appliance are dropped, the appliance will terminate its event loop and be destroyed.
Implementations
impl<'a, A: ?Sized + 'a> ApplianceHandle<'a, A>
[src]
pub fn send_sync<M>(&self, message: M) -> Result<(), Error> where
M: HandledBy<A> + 'a,
[src]
M: HandledBy<A> + 'a,
Sends a message to the current appliance without waiting for the message to be handled.
pub async fn send_async<M>(&self, message: M) -> Result<(), Error> where
M: HandledBy<A> + 'a,
[src]
M: HandledBy<A> + 'a,
Does conceptually the same thing as send_sync
but gets intended
to be used in async context.
pub fn send_and_wait_sync<M>(
&self,
message: M,
timeout: Option<Duration>
) -> Result<M::Result, Error> where
M: HandledBy<A> + 'a,
[src]
&self,
message: M,
timeout: Option<Duration>
) -> Result<M::Result, Error> where
M: HandledBy<A> + 'a,
Sends a message to the current appliance and waits
forever, if timeout
is None, or for only given time
for the message to be handled.
This synchronous blocking method is a fit for callers
who don’t use async execution and must be assured that
the message has been handled.
Note, it is supposed to be used less often than send
as it may suffer a significant performance hit due to
synchronization with the handling loop.
pub async fn send_and_wait_async<M>(
&self,
message: M,
timeout: Option<Duration>
) -> Result<M::Result, Error> where
M: HandledBy<A> + 'a,
[src]
&self,
message: M,
timeout: Option<Duration>
) -> Result<M::Result, Error> where
M: HandledBy<A> + 'a,
Does conceptually the same thing as send_and_wait_sync
but gets intended to be used in async context. This method
is well suited for waiting for a result.
Trait Implementations
impl<'a, A: ?Sized + 'a> Clone for ApplianceHandle<'a, A>
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, A: ?Sized + 'a> Debug for ApplianceHandle<'a, A>
[src]
Auto Trait Implementations
impl<'a, A> !RefUnwindSafe for ApplianceHandle<'a, A>
impl<'a, A: ?Sized> Send for ApplianceHandle<'a, A>
impl<'a, A: ?Sized> Sync for ApplianceHandle<'a, A>
impl<'a, A: ?Sized> Unpin for ApplianceHandle<'a, A>
impl<'a, A> !UnwindSafe for ApplianceHandle<'a, A>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,