Struct MessagePool
pub struct MessagePool { /* private fields */ }Expand description
Message pool for reusing message instances
Implementations§
§impl MessagePool
impl MessagePool
pub fn new() -> MessagePool
pub fn new() -> MessagePool
Create a new message pool
pub fn get_text(&mut self, text: &str) -> FastMessage<'static>
pub fn get_text(&mut self, text: &str) -> FastMessage<'static>
Get a text message from the pool or create a new one
pub fn get_binary(&mut self, data: &[u8]) -> FastMessage<'static>
pub fn get_binary(&mut self, data: &[u8]) -> FastMessage<'static>
Get a binary message from the pool or create a new one
pub fn return_message(&mut self, message: FastMessage<'static>)
pub fn return_message(&mut self, message: FastMessage<'static>)
Return a message to the pool for reuse
Trait Implementations§
§impl Default for MessagePool
impl Default for MessagePool
§fn default() -> MessagePool
fn default() -> MessagePool
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MessagePool
impl RefUnwindSafe for MessagePool
impl Send for MessagePool
impl Sync for MessagePool
impl Unpin for MessagePool
impl UnwindSafe for MessagePool
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