Struct mixnet::reply_manager::ReplyManager
source · pub struct ReplyManager { /* private fields */ }
Expand description
Reply manager state.
Implementations§
source§impl ReplyManager
impl ReplyManager
sourcepub fn insert<X>(
&mut self,
message: RequestMessage,
mixnet: &mut Mixnet<X>,
) -> Option<(ReplyContext, Vec<u8>)>
pub fn insert<X>( &mut self, message: RequestMessage, mixnet: &mut Mixnet<X>, ) -> Option<(ReplyContext, Vec<u8>)>
Attempt to insert a request.
If the request is already present, posts the reply if necessary, and returns None
. The
caller does not need to do anything more.
If Some
is returned, the caller should handle the request and then call either
abandon
or complete
with the ReplyContext
. The
Vec<u8>
contains the request message data.
sourcepub fn abandon(&mut self, reply_context: ReplyContext)
pub fn abandon(&mut self, reply_context: ReplyContext)
Abandon a request. This should be called if you do not wish to reply at this time. If
insert
is called again with a matching message (same ID), it will return
Some
, and you will have another chance to handle the request.
Auto Trait Implementations§
impl Freeze for ReplyManager
impl RefUnwindSafe for ReplyManager
impl Send for ReplyManager
impl Sync for ReplyManager
impl Unpin for ReplyManager
impl UnwindSafe for ReplyManager
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more