pub struct PacketsPool<T: Sync + Send + 'static> { /* private fields */ }
Implementations§
Source§impl<T: PacketTrait> PacketsPool<T>
impl<T: PacketTrait> PacketsPool<T>
pub fn new( cap: usize, init_data: T::InitData, mem_tracker: &Arc<MemoryTrackerManager>, ) -> Self
pub async fn alloc_packet(&self) -> Packet<T>
pub fn set_size(&self, new_size: usize)
pub fn alloc_packet_blocking(&self) -> Packet<T>
pub fn get_available_items(&self) -> i64
Trait Implementations§
Source§impl<T: PacketTrait> PoolObjectTrait for PacketsPool<T>
impl<T: PacketTrait> PoolObjectTrait for PacketsPool<T>
type InitData = (usize, <T as PoolObjectTrait>::InitData, Arc<MemoryTrackerManager>)
fn allocate_new((cap, init_data, mem_tracker): &Self::InitData) -> Self
fn reset(&mut self)
Auto Trait Implementations§
impl<T> !Freeze for PacketsPool<T>
impl<T> !RefUnwindSafe for PacketsPool<T>
impl<T> Send for PacketsPool<T>
impl<T> Sync for PacketsPool<T>
impl<T> Unpin for PacketsPool<T>
impl<T> !UnwindSafe for PacketsPool<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> 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