[][src]Struct swim_mem::resident::Box

pub struct Box<T: ?Sized, M = ()> { /* fields omitted */ }

A single value, residing in a memory Lease. A Box is a Resident typeclass; it doesn't store any data in its internal structure. Rather, Box 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 Box type.

Lease implementations commonly composed with a Box include:

Box implements LeaseDeref, and LeaseDerefMut, which enables deref coercions from Own<Box<T>> and Mut<Box<T>> to &T and &mut T, and from Ref<Box<T>> to &T. This makes leased boxes "feel" like they contain a value, even though Box is just a typeclass for accessing the value stored in the composing memory Lease.

Trait Implementations

impl<T: ?Sized, M> Resident for Box<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 = 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<L: Lease<Data = T, Meta = M>, T, M> ResidentFromValue<L, T, M> for Box<T, M>[src]

impl<L: Lease<Data = [T], Meta = M>, T: Clone, M> ResidentFromClone<L, [T], M> for Box<[T], M>[src]

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

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

impl<L: Lease> ResidentUnwrap<L> for Box<L::Data, L::Meta> where
    L::Data: Sized
[src]

type Target = L::Data

The type the resident unwraps to.

impl<L: Lease> ResidentDeref<L> for Box<L::Data, L::Meta>[src]

type Target = L::Data

The type the resident dereferences to.

impl<L: Lease> ResidentDerefMut<L> for Box<L::Data, L::Meta>[src]

impl<L: Lease> ResidentAsRef<L, <L as Lease>::Data> for Box<L::Data, L::Meta>[src]

impl<L: Lease> ResidentAsMut<L, <L as Lease>::Data> for Box<L::Data, L::Meta>[src]

impl<L: Lease> ResidentPartialEq<L, L> for Box<L::Data, L::Meta> where
    L::Data: PartialEq
[src]

impl<L: Lease> ResidentEq<L> for Box<L::Data, L::Meta> where
    L::Data: Eq
[src]

impl<L: Lease> ResidentPartialOrd<L, L> for Box<L::Data, L::Meta> where
    L::Data: PartialOrd
[src]

impl<L: Lease> ResidentOrd<L> for Box<L::Data, L::Meta> where
    L::Data: Ord
[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> ResidentHash<L> for Box<L::Data, L::Meta> where
    L::Data: Hash
[src]

impl<L: Lease> ResidentDisplay<L> for Box<L::Data, L::Meta> where
    L::Data: Display
[src]

impl<L: Lease> ResidentDebug<L> for Box<L::Data, L::Meta> where
    L::Data: Debug
[src]

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

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

impl<L1, L2, M> ResidentClone<L1, L2> for Box<str, L1::Meta> where
    L1: Lease<Data = str, Meta = M>,
    L2: Lease<Data = str, Meta = M>,
    M: TryClone
[src]

impl<'b, L1: Lease, L2: Lease> ResidentStow<'b, L1, L2> for Box<L1::Data, L1::Meta> where
    L1::Data: Stow<'b, L2::Data>,
    L1::Meta: Stow<'b, L2::Meta>, 
[src]

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

impl<T: Send, M: Send> Send for Box<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]