Enum orx_pinned_vec::CapacityState
source · pub enum CapacityState {
FixedCapacity(usize),
DynamicCapacity {
current_capacity: usize,
maximum_concurrent_capacity: usize,
},
}
Expand description
Provides detailed information of capacity state of the pinned vector.
This information contains the current capacity which can be obtained by capacity()
method and extends with additional useful information.
FixedCapacity
variant only provides the current capacity. However, its additional tag informs that this capacity is a hard constraint and the vector cannot grow beyond it.DynamicCapacity
variant informs that the vector is capable of allocating and growing its capacity. It providescurrent_capacity
representing the current internal state of the vector. Additionally,maximum_concurrent_capacity
is provided. This number represents the maximum number of elements that can safely be pushed to the vector in a concurrent program.
Variants§
FixedCapacity(usize)
FixedCapacity
variant only provides the current capacity.
However, its additional tag informs that this capacity is a hard constraint and the vector cannot grow beyond it.
DynamicCapacity
DynamicCapacity
variant informs that the vector is capable of allocating and growing its capacity.
It provides current_capacity
representing the current internal state of the vector.
Additionally, maximum_concurrent_capacity
is provided.
This number represents the maximum number of elements that can safely be pushed to the vector in a concurrent program.
This value is often related with the capacity of the container holding meta information about allocations.
Note that the dynamic vector can naturally grow beyond this number, this bound is only relevant when the vector is Sync
ed among threads.
Fields
maximum_concurrent_capacity: usize
Maximum capacity that can safely be reached by the vector in a concurrent program.
This value is often related with the capacity of the container holding meta information about allocations.
Note that the dynamic vector can naturally grow beyond this number, this bound is only relevant when the vector is Sync
ed among threads.
Implementations§
source§impl CapacityState
impl CapacityState
sourcepub fn current_capacity(&self) -> usize
pub fn current_capacity(&self) -> usize
Capacity of current allocations owned by the vector.
sourcepub fn maximum_concurrent_capacity(&self) -> usize
pub fn maximum_concurrent_capacity(&self) -> usize
Maximum capacity that can safely be reached by the vector in a concurrent program.
This value is often related with the capacity of the container holding meta information about allocations.
Note that the dynamic vector can naturally grow beyond this number, this bound is only relevant when the vector is Sync
ed among threads.
Trait Implementations§
source§impl Clone for CapacityState
impl Clone for CapacityState
source§fn clone(&self) -> CapacityState
fn clone(&self) -> CapacityState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CapacityState
impl Debug for CapacityState
source§impl PartialEq for CapacityState
impl PartialEq for CapacityState
impl Copy for CapacityState
impl Eq for CapacityState
impl StructuralPartialEq for CapacityState
Auto Trait Implementations§
impl Freeze for CapacityState
impl RefUnwindSafe for CapacityState
impl Send for CapacityState
impl Sync for CapacityState
impl Unpin for CapacityState
impl UnwindSafe for CapacityState
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)