Struct Thin

Source
pub struct Thin<A: Allocator = Global, I: Index = usize, G: Grow = GrowExact> { /* private fields */ }
Expand description

Parameterize Vec with a custom index type or growth behavior.

Trait Implementations§

Source§

impl<A: Clone + Allocator, I: Clone + Index, G: Clone + Grow> Clone for Thin<A, I, G>

Source§

fn clone(&self) -> Thin<A, I, G>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A: AllocatorDefault, I: Index, G: Grow> ConstDefault for Thin<A, I, G>

Source§

const DEFAULT: Self

The constant default value.
Source§

impl<A: Debug + Allocator, I: Debug + Index, G: Debug + Grow> Debug for Thin<A, I, G>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A: Default + Allocator, I: Default + Index, G: Default + Grow> Default for Thin<A, I, G>

Source§

fn default() -> Thin<A, I, G>

Returns the “default value” for a type. Read more
Source§

impl<A: PartialEq + Allocator, I: PartialEq + Index, G: PartialEq + Grow> PartialEq for Thin<A, I, G>

Source§

fn eq(&self, other: &Thin<A, I, G>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<A: Allocator, I: Index, G: Grow> VecConfig for Thin<A, I, G>

Source§

type Buffer<T> = ThinBuffer<T, VecHeader, A>

The internal buffer type.
Source§

type Grow = GrowDoubling

The growth strategy.
Source§

type Index = usize

The index type used to define the capacity and length.
Source§

impl<T, A: Allocator, I: Index, G: Grow> VecConfigAlloc<T> for Thin<A, I, G>

Source§

type Alloc = A

The allocator instance type.
Source§

fn allocator(buf: &Self::Buffer<T>) -> &Self::Alloc

Get a reference to the allocator instance.
Source§

fn buffer_from_parts( data: NonNull<T>, length: Self::Index, capacity: Self::Index, alloc: Self::Alloc, ) -> Self::Buffer<T>

Create a Vec buffer instance from its constituent parts.
Source§

fn buffer_into_parts( buffer: Self::Buffer<T>, ) -> (NonNull<T>, Self::Index, Self::Index, Self::Alloc)

Disassemble a Vec buffer instance into its constituent parts.
Source§

impl<T, A: AllocatorDefault, I: Index, G: Grow> VecConfigNew<T> for Thin<A, I, G>

Source§

const EMPTY_BUFFER: Self::Buffer<T> = ThinBuffer<T, VecHeader<usize>, A>::DEFAULT

Constant initializer for an empty buffer.
Source§

fn buffer_try_new( capacity: Self::Index, exact: bool, ) -> Result<Self::Buffer<T>, StorageError>

Try to create a new buffer instance with a given capacity.
Source§

impl<T, A: Allocator + Clone, I: Index, G: Grow> VecConfigSpawn<T> for Thin<A, I, G>

Source§

fn buffer_try_spawn( buf: &Self::Buffer<T>, capacity: Self::Index, exact: bool, ) -> Result<Self::Buffer<T>, StorageError>

Try to create a new buffer instance with a given capacity.
Source§

impl<T, A: AllocatorDefault, I: Index, G: Grow> VecNewIn<T> for Thin<A, I, G>

Source§

type Config = Thin<A, I, G>

The associated Vec configuration type.
Source§

fn buffer_try_new_in( self, capacity: <Self::Config as VecConfig>::Index, exact: bool, ) -> Result<<Self::Config as VecConfig>::Buffer<T>, StorageError>

Try to create a new buffer given an allocation target.
Source§

impl<A: Eq + Allocator, I: Eq + Index, G: Eq + Grow> Eq for Thin<A, I, G>

Source§

impl<A: Allocator, I: Index, G: Grow> StructuralPartialEq for Thin<A, I, G>

Auto Trait Implementations§

§

impl<A, I, G> Freeze for Thin<A, I, G>
where A: Freeze,

§

impl<A, I, G> RefUnwindSafe for Thin<A, I, G>

§

impl<A, I, G> Send for Thin<A, I, G>
where A: Send, G: Send,

§

impl<A, I, G> Sync for Thin<A, I, G>
where A: Sync, G: Sync,

§

impl<A, I, G> Unpin for Thin<A, I, G>
where A: Unpin, I: Unpin, G: Unpin,

§

impl<A, I, G> UnwindSafe for Thin<A, I, G>
where A: UnwindSafe, I: UnwindSafe, G: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, A> ToOwnedIn<A> for T
where T: Clone + 'static, A: Allocator,

Source§

type Owned = T

The owned representation of this type.
Source§

fn try_to_owned_in<I>( &self, _alloc_in: I, ) -> Result<<T as ToOwnedIn<A>>::Owned, StorageError>
where I: AllocateIn<Alloc = A>,

To to create an owned copy of this instance in a given allocation target.
Source§

fn to_owned_in<I>(&self, alloc_in: I) -> Self::Owned
where I: AllocateIn<Alloc = A>,

Create an owned copy of this instance in a given allocation target.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.