[][src]Struct gvec::LightVecAllocator

pub struct LightVecAllocator { /* fields omitted */ }

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

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]