[−][src]Enum ffimage::packed::dynamic::MemoryView
Runtime memory view
Variants
Implementations
impl<'a> MemoryView<'a>
[src]
pub fn as_slice<T: 'static>(&self) -> Option<&[T]>
[src]
Returns the slice representation of a memory view
It is ensured that only the proper type representation can be cast from the underlying view. If, for example, you were to call the method on a U16 view and try to get a u8 slice reference, the function would return None instead.
Example
use std::convert::TryFrom; use ffimage::packed::dynamic::MemoryView; let mem: Vec<u8> = vec![0; 12]; let view = MemoryView::try_from(&mem[..]) .expect("Failed to wrap memory region"); let slice: &[u8] = view.as_slice() .expect("Failed to cast memory view");
pub fn len(&self) -> usize
[src]
Returns the number of elements in the view
pub fn is_empty(&self) -> bool
[src]
Returns true if there are no elements in the view
Trait Implementations
impl<'a, '_> From<&'_ MemoryView<'a>> for MemoryBuffer
[src]
fn from(view: &MemoryView<'a>) -> Self
[src]
impl<'a, T: 'static, '_> TryFrom<&'_ [T]> for MemoryView<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for MemoryView<'a>
impl<'a> Send for MemoryView<'a>
impl<'a> Sync for MemoryView<'a>
impl<'a> Unpin for MemoryView<'a>
impl<'a> UnwindSafe for MemoryView<'a>
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, 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>,