[−][src]Struct framering::LinearCapacity
Implementation of capacity which represents the capacity as usize. Does not support infinite addressing, and will panic if more than usize::MAX elements are inserted in a forward fashion (due to addition overflow).
LinearCapacity does not necessarily grow in a doubling fashion - if bulk addition requires more elements than a standard doubling, the FramedRing will expand to fit all of the elements instead.
Example
let mut ring = FramedRing::<i32, LinearCapacity>::with_capacity(LinearCapacity{cap: 9}); assert_eq!(ring.capacity(), 9);
Fields
cap: usize
Trait Implementations
impl Capacity for LinearCapacity
[src]
type Baser = usize
type Masker = usize
pub fn size(&self) -> usize
[src]
pub fn size_array<T>(&self) -> usize
[src]
pub fn increase(&self, new_capacity: usize) -> Result<Self, ()>
[src]
pub fn make_mask(&self) -> usize
[src]
pub fn make_base(&self) -> usize
[src]
pub fn mask(mask: &usize, val: usize) -> usize
[src]
pub fn base(mask: &usize, val: usize) -> usize
[src]
pub fn add(a: usize, b: usize) -> usize
[src]
impl Clone for LinearCapacity
[src]
pub fn clone(&self) -> LinearCapacity
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for LinearCapacity
[src]
impl Default for LinearCapacity
[src]
Auto Trait Implementations
impl RefUnwindSafe for LinearCapacity
[src]
impl Send for LinearCapacity
[src]
impl Sync for LinearCapacity
[src]
impl Unpin for LinearCapacity
[src]
impl UnwindSafe for LinearCapacity
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,