pub struct Sdk<'a, M>(_, _);
Available on crate feature
fibers
only.Implementations§
source§impl<'a, M> Sdk<'a, M>
impl<'a, M> Sdk<'a, M>
pub fn deadline(&self, duration: Duration) -> Deadline
pub fn deadline_elapsed(&self, deadline: Deadline) -> bool
pub fn exit(&self) -> !
pub fn expect(&self, description: impl ToString) -> Expectation
pub fn expectation_met(&self, expectation: Expectation)
pub fn id(&self) -> Id
pub fn recv(&self) -> (Id, M)
pub fn recv_btree_map<K, V>( &self, count: usize, filter_map: impl Fn(Id, M) -> Option<(K, V)> ) -> BTreeMap<K, V>where K: Ord,
pub fn recv_btree_set<V>( &self, count: usize, filter_map: impl Fn(Id, M) -> Option<V> ) -> BTreeSet<V>where V: Ord,
sourcepub fn recv_response_count(&self, count: usize, filter: impl Fn(Id, M) -> bool)
pub fn recv_response_count(&self, count: usize, filter: impl Fn(Id, M) -> bool)
This is a helper based on Sdk::recv_btree_set
for the case where an actor needs to
wait for count
messages from distinct recipients (e.g. when awaiting
quorum).
count
will match the number of distinct Id
s for which the filter
returned
true
(i.e. accepted messages from the same Id
are only counted once).
sourcepub fn recv_responses<V>(
&self,
count: usize,
filter_map: impl Fn(Id, M) -> Option<V>
) -> BTreeMap<Id, V>
pub fn recv_responses<V>( &self, count: usize, filter_map: impl Fn(Id, M) -> Option<V> ) -> BTreeMap<Id, V>
This is a helper based on Sdk::recv_btree_map
for the case where an actor needs to
wait for count
messages from distinct recipients (e.g. when awaiting
quorum).
count
will match the number of distinct Id
s for which the filter_map
returned
Some(...)
(i.e. accepted messages from the same Id
are only counted once).
pub fn send(&self, dst: Id, m: M)
pub fn send_broadcast(&self, dst: impl IntoIterator<Item = Id>, m: &M)where M: Clone,
pub fn sleep_until(&self, deadline: Deadline)
Trait Implementations§
Auto Trait Implementations§
impl<'a, M> !RefUnwindSafe for Sdk<'a, M>
impl<'a, M> !Send for Sdk<'a, M>
impl<'a, M> !Sync for Sdk<'a, M>
impl<'a, M> Unpin for Sdk<'a, M>
impl<'a, M> !UnwindSafe for Sdk<'a, M>
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