[−][src]Struct swim_mem::block::Block
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]
fn eq(&self, other: &Self) -> bool
[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]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
default fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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]
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,