[][src]Struct rdisk_shared::StructBuffer

pub struct StructBuffer<T: Sized> { /* fields omitted */ }

Methods

impl<T: Sized + Clone + Copy> StructBuffer<T>[src]

pub unsafe fn new() -> Self[src]

Creates a buffer capable to hold the value of type T.

Safety

The buffer is uninitialized!

pub unsafe fn with_ext(ext_size: usize) -> Self[src]

Creates a buffer capable to hold the value of type T plus ext_size bytes.

Safety

The buffer is uninitialized!

pub unsafe fn with_buffer(buffer: Vec<u8>) -> Self[src]

Creates a StructBuffer for the type T using supplied buffer.

Safety

The buffer size should be >= mem::size_of::() !

pub fn with_value(value: &T) -> Self[src]

Creates a StructBuffer for the type T using supplied T value.

Safety

The buffer size should be >= mem::size_of::() !

pub fn zeroed() -> Self[src]

Creates the value of type T represented by the all-zero byte-pattern.

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

pub fn raw(&self) -> &T[src]

pub fn raw_mut(&mut self) -> &mut T[src]

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

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

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

pub fn has_ext_buffer(&self) -> bool[src]

pub fn copy(&self) -> T[src]

pub fn take(self) -> T[src]

Trait Implementations

impl<T: Sized + Clone + Copy> AsByteSlice for StructBuffer<T>[src]

impl<T: Sized + Clone + Copy> AsByteSliceMut for StructBuffer<T>[src]

impl<T: Clone + Sized> Clone for StructBuffer<T>[src]

impl<T: Sized + Clone + Copy> Deref for StructBuffer<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T: Sized + Clone + Copy> DerefMut for StructBuffer<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for StructBuffer<T> where
    T: RefUnwindSafe

impl<T> Send for StructBuffer<T> where
    T: Send

impl<T> Sync for StructBuffer<T> where
    T: Sync

impl<T> Unpin for StructBuffer<T> where
    T: Unpin

impl<T> UnwindSafe for StructBuffer<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.