[][src]Struct swim_mem::block::Block

pub struct Block<'a> { /* fields omitted */ }

Address, size, and lifetime of a raw memory area.

Methods

impl<'a> Block<'a>[src]

pub const fn empty() -> Block<'a>[src]

Returns a zero-length Block with an undereferenceable sentinel pointer.

pub const unsafe fn from_raw_parts(data: *mut u8, size: usize) -> Block<'a>[src]

Constructs a Block from a non-zero data pointer to size bytes.

Safety

The returned Block logically takes ownership of the pointed-to data.

pub fn from_slice(slice: &'a mut [u8]) -> Block<'a>[src]

Constructs a Block from a slice of bytes.

Safety

The returned Block logically takes ownership of the bytes in slice.

pub fn size(&self) -> usize[src]

Returns the number of bytes of memory owned by this Block.

pub fn as_slice(&self) -> &[u8][src]

Returns a slice of the memory owned by this Block.

pub fn as_mut_slice(&mut self) -> &mut [u8][src]

Returns a mutable slice of the memory owned by this Block.

pub fn as_ptr(&self) -> *mut u8[src]

Returns a pointer to the memory owned by this Block.

pub fn into_raw(self) -> *mut u8[src]

Consumes this Block and returns a mutable pointer to its memory.

Trait Implementations

impl<'a> PartialEq<Block<'a>> for Block<'a>[src]

#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl<'a> Eq for Block<'a>[src]

impl<'a> Debug for Block<'a>[src]

impl<'a> Hash for Block<'a>[src]

default fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a> Sync for Block<'a>[src]

impl<'a> Send for Block<'a>[src]

impl<'a> Copy for Block<'a>[src]

impl<'a> Pointer for Block<'a>[src]

impl<'a> Clone for Block<'a>[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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]