Enum orx_imp_vec::prelude::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.
FixedCapacityvariant only provides the current capacity. However, its additional tag informs that this capacity is a hard constraint and the vector cannot grow beyond it.DynamicCapacityvariant informs that the vector is capable of allocating and growing its capacity. It providescurrent_capacityrepresenting the current internal state of the vector. Additionally,maximum_concurrent_capacityis 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 Synced among threads.
Fields
maximum_concurrent_capacity: usizeMaximum 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 Synced 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 Synced 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
sourceยงfn eq(&self, other: &CapacityState) -> bool
fn eq(&self, other: &CapacityState) -> bool
self and other values to be equal, and is used
by ==.