[−][src]Struct gvec::LightVecAllocator
Allocator for the LightVec
Although not really an allocator, this entity guarantees that an action
done to the vector will not violate the Generational scheme, or versioning
scheme. For the time being, this must be passed as parameter to any
LightVec function, such as insert or remove, in order to make those
guarantees. The allocator can be instantiated with the lvec! macro, or with
the new()
function.
Similar to the LightVec itself, the allocator can handle reallocations in case of insertion when the Vec is above capacity. In order to reduce overhead due to frequent reallocations, there is a setting in the allocator, called loan, which is used as way to assure how much memory is "loaned" when there is a reallocation. Default value for the loan is 1.
Methods
impl LightVecAllocator
[src]
pub fn set_loan(&mut self, loan: usize)
[src]
Sets the loan
Sets the loan strategy, or a simple value, to be used in reallocations during insertion.
Default value on Allocator creation is set to 1.
pub fn loan(&self) -> usize
[src]
Returns the loan value
Returns the loan value used in the loan strategy for reallocation
Auto Trait Implementations
impl Send for LightVecAllocator
impl Sync for LightVecAllocator
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for 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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,