Trait unix_udp_sock::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<T> AsPtr<T> for Vec<T>

source§

fn as_ptr(&self) -> *const T

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 AsPtr<u8> for BytesMut

source§

fn as_ptr(&self) -> *const u8

source§

fn len(&self) -> usize

source§

impl AsPtr<u8> for Bytes

source§

fn as_ptr(&self) -> *const u8

source§

fn len(&self) -> usize

Implementors§