[][src]Struct swim_mem::resident::Buf

pub struct Buf<T, M = ()> { /* fields omitted */ }

A resizeable array of values, residing in a memory Lease. A Buf is a Resident typeclass; it doesn't store any data in its internal structure. Rather, Buf implements an access pattern for memory blocks managed by a Lease. A composing Lease type defines the memory allocation and ownership semantics of the composed Buf type.

Lease implementations commonly composed with a Buf include:

Buf implements LeaseDeref, and LeaseDerefMut, which enables deref coercions from Own<Buf<T>>, Mut<Buf<T>>, and Ref<Buf<T>> to &BufLease<L, T>. BufLease in turn deref coerces to &[T] and &mut [T]. This makes leased bufs "feel" like they contain a slice, even though Buf is just a typeclass for accessing the slice stored in the composing memory Lease. Most buffer operations are defined on BufLease; Buf can't do much on its own since it doesn't actually contain any data.

Trait Implementations

impl<T, M> Resident for Buf<T, M>[src]

type Data = T

The type of pointed-to data stored in leased memory blocks. The size of leased memory blocks must be a positive multiple of the Data size. Read more

type Meta = BufHeader<M>

The type of metadata stored with leased memory blocks. Meta data must contain sufficient information to resolve the size of any resided-in memory Lease. Read more

impl<'a, L: Lease<Data = T, Meta = BufHeader<M>> + Holder<'a>, T, U: CloneIntoHold<'a, T>, M> ResidentFromClone<L, [U], M> for Buf<T, M>[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T: Copy, M> ResidentFromCopy<L, [T], M> for Buf<T, M>[src]

impl<L: Lease<Data = u8, Meta = BufHeader<M>>, M> ResidentFromCopy<L, str, M> for Buf<u8, M>[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T, M> ResidentFromEmpty<L, M> for Buf<T, M>[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T, M> ResidentWithCapacity<L, M> for Buf<T, M>[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T, M> ResidentDeref<L> for Buf<T, M>[src]

type Target = BufLease<L, T, M>

The type the resident dereferences to.

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T, M> ResidentDerefMut<L> for Buf<T, M>[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T, M> ResidentAsRef<L, [T]> for Buf<T, M>[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T, M> ResidentAsMut<L, [T]> for Buf<T, M>[src]

impl<L: Lease<Meta = BufHeader<M>>, Idx: SliceIndex<[L::Data]>, M> ResidentIndex<L, Idx> for Buf<L::Data, M> where
    L::Data: Sized
[src]

type Output = Idx::Output

The type of values indexed by the resident for the parameterized Idx type.

impl<L: Lease<Meta = BufHeader<M>>, Idx: SliceIndex<[L::Data]>, M> ResidentIndexMut<L, Idx> for Buf<L::Data, M> where
    L::Data: Sized
[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T, M> ResidentIntoIterator<L> for Buf<T, M>[src]

type Item = T

The type of element to iterator over.

type IntoIter = BufIter<L, T, M>

The type of iterator to return.

impl<'a, L: Lease<Data = T, Meta = BufHeader<M>>, T: 'a, M> ResidentIntoRefIterator<'a, L> for Buf<T, M>[src]

type Item = &'a T

The type of element to iterator over.

type IntoIter = Iter<'a, T>

The type of iterator to return.

impl<'a, L: Lease<Data = T, Meta = BufHeader<M>>, T: 'a, M> ResidentIntoMutIterator<'a, L> for Buf<T, M>[src]

type Item = &'a mut T

The type of element to iterator over.

type IntoIter = IterMut<'a, T>

The type of iterator to return.

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T: PartialEq, M> ResidentPartialEq<L, L> for Buf<T, M>[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T: Eq, M> ResidentEq<L> for Buf<T, M>[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T: PartialOrd, M> ResidentPartialOrd<L, L> for Buf<T, M>[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T: Ord, M> ResidentOrd<L> for Buf<T, M>[src]

fn resident_lt(lease: &L, other: &L) -> bool[src]

fn resident_le(lease: &L, other: &L) -> bool[src]

fn resident_ge(lease: &L, other: &L) -> bool[src]

fn resident_gt(lease: &L, other: &L) -> bool[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T: Hash, M> ResidentHash<L> for Buf<T, M>[src]

impl<L: Lease<Data = T, Meta = BufHeader<M>>, T: Debug, M> ResidentDebug<L> for Buf<T, M>[src]

impl<L1, L2, T, M> ResidentClone<L1, L2> for Buf<T, M> where
    L1: Lease<Data = T, Meta = BufHeader<M>>,
    L2: Lease<Data = T, Meta = BufHeader<M>>,
    T: TryClone,
    M: TryClone
[src]

impl<'b, L1, L2, T, M> ResidentStow<'b, L1, L2> for Buf<T, M> where
    L1: Lease<Data = T, Meta = BufHeader<M>>,
    L2: Lease<Data = T, Meta = BufHeader<M>>,
    T: TryClone,
    M: TryClone
[src]

impl<T: Sync, M: Sync> Sync for Buf<T, M>[src]

impl<T: Send, M: Send> Send for Buf<T, M>[src]

Blanket Implementations

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto 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, U> Into for T where
    U: From<T>, 
[src]

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

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

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