pub struct RecyclableConnection { /* private fields */ }Expand description
Extended connection with full recycling support.
Implementations§
Source§impl RecyclableConnection
impl RecyclableConnection
Sourcepub fn with_capacities(read_capacity: usize, write_capacity: usize) -> Self
pub fn with_capacities(read_capacity: usize, write_capacity: usize) -> Self
Create with buffer capacity hints.
Sourcepub fn inner(&self) -> &Connection
pub fn inner(&self) -> &Connection
Get the inner connection.
Sourcepub fn inner_mut(&mut self) -> &mut Connection
pub fn inner_mut(&mut self) -> &mut Connection
Get mutable inner connection.
Sourcepub fn recycle_count(&self) -> u64
pub fn recycle_count(&self) -> u64
Get total recycle count.
Sourcepub fn read_buffer_capacity(&self) -> usize
pub fn read_buffer_capacity(&self) -> usize
Get read buffer capacity hint.
Sourcepub fn write_buffer_capacity(&self) -> usize
pub fn write_buffer_capacity(&self) -> usize
Get write buffer capacity hint.
Sourcepub fn set_buffer_capacities(&mut self, read: usize, write: usize)
pub fn set_buffer_capacities(&mut self, read: usize, write: usize)
Set buffer capacity hints for next use.
Sourcepub fn set_user_data<T: Any + Send + Sync + 'static>(&mut self, data: T)
pub fn set_user_data<T: Any + Send + Sync + 'static>(&mut self, data: T)
Set user data.
Sourcepub fn handle_event(&mut self, event: ConnectionEvent) -> TransitionAction
pub fn handle_event(&mut self, event: ConnectionEvent) -> TransitionAction
Handle event (delegates to inner).
Sourcepub fn state(&self) -> ConnectionState
pub fn state(&self) -> ConnectionState
Get state (delegates to inner).
Sourcepub fn prepare_for_recycle(&mut self)
pub fn prepare_for_recycle(&mut self)
Prepare for recycling - clean up and return to pool.
Trait Implementations§
Source§impl Debug for RecyclableConnection
impl Debug for RecyclableConnection
Source§impl Default for RecyclableConnection
impl Default for RecyclableConnection
Source§impl Recyclable for RecyclableConnection
impl Recyclable for RecyclableConnection
Source§fn generation(&self) -> u64
fn generation(&self) -> u64
Get the generation counter (for use-after-recycle detection).
Source§fn increment_generation(&mut self)
fn increment_generation(&mut self)
Increment the generation counter.
Auto Trait Implementations§
impl Freeze for RecyclableConnection
impl !RefUnwindSafe for RecyclableConnection
impl Send for RecyclableConnection
impl Sync for RecyclableConnection
impl Unpin for RecyclableConnection
impl !UnwindSafe for RecyclableConnection
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> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging