Struct legacytranslate::MessageBuffer
source · pub struct MessageBuffer<M: Message> { /* private fields */ }
Expand description
Raw message buffer
Instead of localizing and printing messages this buffers raw
messages and makes them available with get_messages()
.
Implementations§
source§impl<M> MessageBuffer<M>where
M: Message,
impl<M> MessageBuffer<M>where M: Message,
sourcepub fn new() -> Self
pub fn new() -> Self
Creating a new MessageBuffer
This creates a new message buffer.
sourcepub fn get_messages(&self) -> Vec<M>
pub fn get_messages(&self) -> Vec<M>
Returns the buffered messages
This function takes and returns the buffered messages. Taken messages are removed, so a second call will not return the old messages again, but only the new.
Trait Implementations§
source§impl<M: Clone + Message> Clone for MessageBuffer<M>
impl<M: Clone + Message> Clone for MessageBuffer<M>
source§fn clone(&self) -> MessageBuffer<M>
fn clone(&self) -> MessageBuffer<M>
Returns a copy 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<M> Default for MessageBuffer<M>where
M: Message,
impl<M> Default for MessageBuffer<M>where M: Message,
source§impl<M> MessageHandler<M> for &mut MessageBuffer<M>where
M: Message,
impl<M> MessageHandler<M> for &mut MessageBuffer<M>where M: Message,
Auto Trait Implementations§
impl<M> RefUnwindSafe for MessageBuffer<M>
impl<M> Send for MessageBuffer<M>where M: Send,
impl<M> Sync for MessageBuffer<M>where M: Send,
impl<M> Unpin for MessageBuffer<M>
impl<M> UnwindSafe for MessageBuffer<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