[][src]Trait swim_mem::resident::ResidentWithCapacity

pub trait ResidentWithCapacity<L: Lease, M = ()>: Resident {
    fn new_resident_layout(cap: usize, meta: &M) -> Result<Layout, LayoutError>;
fn new_resident_ptr(raw: *mut u8, cap: usize, meta: &M) -> *mut Self::Data;
fn new_resident(lease: &mut L, cap: usize, meta: M); }

A type that can initialize a new memory Lease with a preallocated capacity, and an empty Resident.

Required methods

fn new_resident_layout(cap: usize, meta: &M) -> Result<Layout, LayoutError>

Returns the memory layout for an empty resident with the given pre-allocated capacity and meta data.

fn new_resident_ptr(raw: *mut u8, cap: usize, meta: &M) -> *mut Self::Data

Converts a raw pointer into a Data pointer for an empty resident with the given preallocated capacity and meta data.

fn new_resident(lease: &mut L, cap: usize, meta: M)

Initializes the lease with an empty resident from the given pre-allocated capacity and meta data.

Loading content...

Implementors

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

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

Loading content...