Skip to main content

ReplyManager

Struct ReplyManager 

Source
pub struct ReplyManager<Id, R, E>
where Id: Eq + Hash,
{ /* private fields */ }

Implementations§

Source§

impl<Id, R, E> ReplyManager<Id, R, E>
where Id: Eq + Hash + Clone,

Source

pub fn new(tick_interval: Duration) -> Self

Source

pub fn register( &self, id: impl Into<Id>, expires_in: Duration, ) -> Receiver<Reply<R, E>> ⓘ

Source

pub fn ok(&self, id: &Id, result: R)

Source

pub fn error(&self, id: &Id, error: E)

Source

pub async fn vacuum(&self)

Auto Trait Implementations§

§

impl<Id, R, E> !Freeze for ReplyManager<Id, R, E>

§

impl<Id, R, E> RefUnwindSafe for ReplyManager<Id, R, E>
where Mutex<HashMap<Id, Sender<Reply<R, E>>>>: RefUnwindSafe, RwLock<BinaryHeap<RegisteredTimeout<Id>>>: RefUnwindSafe,

§

impl<Id, R, E> Send for ReplyManager<Id, R, E>
where Mutex<HashMap<Id, Sender<Reply<R, E>>>>: Send, RwLock<BinaryHeap<RegisteredTimeout<Id>>>: Send,

§

impl<Id, R, E> Sync for ReplyManager<Id, R, E>
where Mutex<HashMap<Id, Sender<Reply<R, E>>>>: Sync, RwLock<BinaryHeap<RegisteredTimeout<Id>>>: Sync,

§

impl<Id, R, E> Unpin for ReplyManager<Id, R, E>
where Mutex<HashMap<Id, Sender<Reply<R, E>>>>: Unpin, RwLock<BinaryHeap<RegisteredTimeout<Id>>>: Unpin,

§

impl<Id, R, E> UnsafeUnpin for ReplyManager<Id, R, E>
where Mutex<HashMap<Id, Sender<Reply<R, E>>>>: UnsafeUnpin, RwLock<BinaryHeap<RegisteredTimeout<Id>>>: UnsafeUnpin,

§

impl<Id, R, E> UnwindSafe for ReplyManager<Id, R, E>
where Mutex<HashMap<Id, Sender<Reply<R, E>>>>: UnwindSafe, RwLock<BinaryHeap<RegisteredTimeout<Id>>>: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.