Struct Summoner

Source
pub struct Summoner<T, R> { /* private fields */ }
Expand description

Deferred Caller with built-in reply pipe

if the method’s last parameter is an async_channel::Sender, you can turn your Caller into a Summoner, which makes it easy to wait for a reply when you schedule a call.

Implementations§

Source§

impl<T, R> Summoner<T, R>

Source

pub fn new(inner: Caller<T>) -> Self

Source§

impl<R> Summoner<(Instant, Sender<R>), R>

Source

pub async fn summon(&self) -> R

Schedule a call to the callback and wait for a reply

Source§

impl<P1, R> Summoner<(Instant, P1, Sender<R>), R>

Source

pub async fn summon(&self, a: P1) -> R

Schedule a call to the callback and wait for a reply

Source§

impl<P1, P2, R> Summoner<(Instant, P1, P2, Sender<R>), R>

Source

pub async fn summon(&self, a: P1, b: P2) -> R

Schedule a call to the callback and wait for a reply

Source§

impl<P1, P2, P3, R> Summoner<(Instant, P1, P2, P3, Sender<R>), R>

Source

pub async fn summon(&self, a: P1, b: P2, c: P3) -> R

Schedule a call to the callback and wait for a reply

Source§

impl<P1, P2, P3, P4, R> Summoner<(Instant, P1, P2, P3, P4, Sender<R>), R>

Source

pub async fn summon(&self, a: P1, b: P2, c: P3, d: P4) -> R

Schedule a call to the callback and wait for a reply

Source§

impl<P1, P2, P3, P4, P5, R> Summoner<(Instant, P1, P2, P3, P4, P5, Sender<R>), R>

Source

pub async fn summon(&self, a: P1, b: P2, c: P3, d: P4, e: P5) -> R

Schedule a call to the callback and wait for a reply

Source§

impl<P1, P2, P3, P4, P5, P6, R> Summoner<(Instant, P1, P2, P3, P4, P5, P6, Sender<R>), R>

Source

pub async fn summon(&self, a: P1, b: P2, c: P3, d: P4, e: P5, f: P6) -> R

Schedule a call to the callback and wait for a reply

Trait Implementations§

Source§

impl<T: Debug, R: Debug> Debug for Summoner<T, R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T, R> Freeze for Summoner<T, R>

§

impl<T, R> RefUnwindSafe for Summoner<T, R>

§

impl<T, R> Send for Summoner<T, R>
where R: Send, T: Send,

§

impl<T, R> Sync for Summoner<T, R>
where R: Send, T: Send,

§

impl<T, R> !Unpin for Summoner<T, R>

§

impl<T, R> UnwindSafe for Summoner<T, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.