pub struct Caller<T> { /* private fields */ }
Expand description
Deferred Caller
When you create a Caller
for a method of T
using Dispatcher
, a background
task is created, waiting for you to schedule deferred calls via the Caller
. When
a call is scheduled, the background task will lock the RwLock
or Mutex
and call
the method on the locked T
instance.
§Compatible T
methods
The methods must:
- be asynchronous
- return
Result<(), String>
They can take self
mutably or immutably.
Note: you can use a freestanding function instead of a method if the first parameter
of that function is &T
or &mut T
.
Implementations§
Source§impl<P1, P2, P3, P4, P5> Caller<(Instant, P1, P2, P3, P4, P5)>
impl<P1, P2, P3, P4, P5> Caller<(Instant, P1, P2, P3, P4, P5)>
Sourcepub fn call(
&self,
a: P1,
b: P2,
c: P3,
d: P4,
e: P5,
) -> Send<'_, (Instant, P1, P2, P3, P4, P5)>
pub fn call( &self, a: P1, b: P2, c: P3, d: P4, e: P5, ) -> Send<'_, (Instant, P1, P2, P3, P4, P5)>
Schedule a call to the callback
Sourcepub fn call_later(
&self,
when: Instant,
a: P1,
b: P2,
c: P3,
d: P4,
e: P5,
) -> Send<'_, (Instant, P1, P2, P3, P4, P5)>
pub fn call_later( &self, when: Instant, a: P1, b: P2, c: P3, d: P4, e: P5, ) -> Send<'_, (Instant, P1, P2, P3, P4, P5)>
Schedule a delayed call to the callback
Source§impl<P1, P2, P3, P4, P5, P6> Caller<(Instant, P1, P2, P3, P4, P5, P6)>
impl<P1, P2, P3, P4, P5, P6> Caller<(Instant, P1, P2, P3, P4, P5, P6)>
Sourcepub fn call(
&self,
a: P1,
b: P2,
c: P3,
d: P4,
e: P5,
f: P6,
) -> Send<'_, (Instant, P1, P2, P3, P4, P5, P6)>
pub fn call( &self, a: P1, b: P2, c: P3, d: P4, e: P5, f: P6, ) -> Send<'_, (Instant, P1, P2, P3, P4, P5, P6)>
Schedule a call to the callback
Sourcepub fn call_later(
&self,
when: Instant,
a: P1,
b: P2,
c: P3,
d: P4,
e: P5,
f: P6,
) -> Send<'_, (Instant, P1, P2, P3, P4, P5, P6)>
pub fn call_later( &self, when: Instant, a: P1, b: P2, c: P3, d: P4, e: P5, f: P6, ) -> Send<'_, (Instant, P1, P2, P3, P4, P5, P6)>
Schedule a delayed call to the callback
Source§impl<P1, P2, P3, P4, P5, P6, P7> Caller<(Instant, P1, P2, P3, P4, P5, P6, P7)>
impl<P1, P2, P3, P4, P5, P6, P7> Caller<(Instant, P1, P2, P3, P4, P5, P6, P7)>
Sourcepub fn call(
&self,
a: P1,
b: P2,
c: P3,
d: P4,
e: P5,
f: P6,
g: P7,
) -> Send<'_, (Instant, P1, P2, P3, P4, P5, P6, P7)>
pub fn call( &self, a: P1, b: P2, c: P3, d: P4, e: P5, f: P6, g: P7, ) -> Send<'_, (Instant, P1, P2, P3, P4, P5, P6, P7)>
Schedule a call to the callback
Sourcepub fn call_later(
&self,
when: Instant,
a: P1,
b: P2,
c: P3,
d: P4,
e: P5,
f: P6,
g: P7,
) -> Send<'_, (Instant, P1, P2, P3, P4, P5, P6, P7)>
pub fn call_later( &self, when: Instant, a: P1, b: P2, c: P3, d: P4, e: P5, f: P6, g: P7, ) -> Send<'_, (Instant, P1, P2, P3, P4, P5, P6, P7)>
Schedule a delayed call to the callback
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Caller<T>
impl<T> RefUnwindSafe for Caller<T>
impl<T> Send for Caller<T>where
T: Send,
impl<T> Sync for Caller<T>where
T: Send,
impl<T> Unpin for Caller<T>
impl<T> UnwindSafe for Caller<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more