[−][src]Struct rdisk_shared::StructBuffer
Methods
impl<T: Sized + Clone + Copy> StructBuffer<T>
[src]
pub unsafe fn new() -> Self
[src]
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]
unsafe fn as_byte_slice(&self) -> &[u8]
[src]
impl<T: Sized + Clone + Copy> AsByteSliceMut for StructBuffer<T>
[src]
unsafe fn as_byte_slice_mut(&mut self) -> &mut [u8]
[src]
impl<T: Clone + Sized> Clone for StructBuffer<T>
[src]
fn clone(&self) -> StructBuffer<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Sized + Clone + Copy> Deref for StructBuffer<T>
[src]
impl<T: Sized + Clone + Copy> DerefMut for StructBuffer<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for StructBuffer<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for StructBuffer<T> where
T: Send,
T: Send,
impl<T> Sync for StructBuffer<T> where
T: Sync,
T: Sync,
impl<T> Unpin for StructBuffer<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for StructBuffer<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> 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<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,