pub struct TypedIntoMessageSavingHandler<T> { /* private fields */ }Expand description
Ownership-based typed handler which saves the messages it receives.
Unlike TypedMessageSavingHandler which borrows messages, this handler
takes ownership which is required for IntoEndpointMap endpoints.
Implementations§
Source§impl<T: 'static> TypedIntoMessageSavingHandler<T>
impl<T: 'static> TypedIntoMessageSavingHandler<T>
pub fn new(id: Option<Ustr>) -> Self
Sourcepub fn new_with_messages(
id: Option<Ustr>,
messages: Rc<RefCell<Vec<T>>>,
) -> Self
pub fn new_with_messages( id: Option<Ustr>, messages: Rc<RefCell<Vec<T>>>, ) -> Self
Creates a handler backed by an existing shared messages vec.
pub fn get_messages(&self) -> Vec<T>where
T: Clone,
Sourcepub fn handler(&self) -> TypedIntoHandler<T>
pub fn handler(&self) -> TypedIntoHandler<T>
Returns a TypedIntoHandler that can be used for endpoint registration.
pub fn clear(&self)
Trait Implementations§
Source§impl<T: Clone> Clone for TypedIntoMessageSavingHandler<T>
impl<T: Clone> Clone for TypedIntoMessageSavingHandler<T>
Source§fn clone(&self) -> TypedIntoMessageSavingHandler<T>
fn clone(&self) -> TypedIntoMessageSavingHandler<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for TypedIntoMessageSavingHandler<T>
impl<T: Debug> Debug for TypedIntoMessageSavingHandler<T>
Source§impl<T: 'static> IntoHandler<T> for TypedIntoMessageSavingHandler<T>
impl<T: 'static> IntoHandler<T> for TypedIntoMessageSavingHandler<T>
Auto Trait Implementations§
impl<T> Freeze for TypedIntoMessageSavingHandler<T>
impl<T> !RefUnwindSafe for TypedIntoMessageSavingHandler<T>
impl<T> !Send for TypedIntoMessageSavingHandler<T>
impl<T> !Sync for TypedIntoMessageSavingHandler<T>
impl<T> Unpin for TypedIntoMessageSavingHandler<T>
impl<T> UnsafeUnpin for TypedIntoMessageSavingHandler<T>
impl<T> !UnwindSafe for TypedIntoMessageSavingHandler<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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