Trait AsPtr

Source
pub trait AsPtr<T> {
    // Required methods
    fn as_ptr(&self) -> *const T;
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

A buffer that can be turned into a raw ptr and has a len. Is used to be generic over Vec, u8, Bytes, BytesMut

Required Methods§

Source

fn as_ptr(&self) -> *const T

Source

fn len(&self) -> usize

Provided Methods§

Source

fn is_empty(&self) -> bool

Implementations on Foreign Types§

Source§

impl AsPtr<u8> for Bytes

Source§

fn as_ptr(&self) -> *const u8

Source§

fn len(&self) -> usize

Source§

impl AsPtr<u8> for BytesMut

Source§

fn as_ptr(&self) -> *const u8

Source§

fn len(&self) -> usize

Source§

impl<T> AsPtr<T> for [T]

Source§

fn as_ptr(&self) -> *const T

Source§

fn len(&self) -> usize

Source§

impl<T> AsPtr<T> for Vec<T>

Source§

fn as_ptr(&self) -> *const T

Source§

fn len(&self) -> usize

Source§

impl<T, const N: usize> AsPtr<T> for &[T; N]

Source§

fn as_ptr(&self) -> *const T

Source§

fn len(&self) -> usize

Source§

impl<T, const N: usize> AsPtr<T> for [T; N]

Source§

fn as_ptr(&self) -> *const T

Source§

fn len(&self) -> usize

Implementors§