Thanks to visit codestin.com
Credit goes to docs.rs

AsPtr

Trait AsPtr 

Source
pub trait AsPtr {
    type Inner;

    // Required methods
    fn as_ptr(&self) -> *const Self::Inner;
    fn as_mut_ptr(&mut self) -> *mut Self::Inner;

    // Provided methods
    fn size(&self) -> usize { ... }
    fn as_bytes(&self) -> &[u8]  { ... }
    fn as_bytes_mut(&mut self) -> &[u8]  { ... }
}
Expand description

Trait to get a pointer to an inner type

Required Associated Types§

Source

type Inner

The inner type to which we resolve as a pointer

Required Methods§

Source

fn as_ptr(&self) -> *const Self::Inner

Gets a const pointer to the inner type

Source

fn as_mut_ptr(&mut self) -> *mut Self::Inner

Gets a mutable pointer to the inner type

Provided Methods§

Source

fn size(&self) -> usize

The size of the inner type

Source

fn as_bytes(&self) -> &[u8]

Gets a byte slice to the inner type

Source

fn as_bytes_mut(&mut self) -> &[u8]

Gets a mutable byte slice to the inner type

Implementors§