Skip to main content

Buffer

Struct Buffer 

Source
pub struct Buffer<'l> { /* private fields */ }

Implementations§

Source§

impl<'l> Buffer<'l>

Source

pub const fn new(buffer: &'l [u8]) -> Buffer<'l>

Source

pub const fn remaining(&self) -> usize

Source

pub const fn size(&self) -> usize

Source

pub const fn empty(&self) -> bool

Source

pub const fn set_offset(self, o: usize) -> Option<Self>

Source

pub const fn skip(self, s: usize) -> Option<Self>

Source

pub fn get_u8(&mut self) -> Option<u8>

Source

pub fn peek_u8(&self) -> Option<u8>

Source

pub fn get_bytes(&mut self, b: usize) -> Option<&'l [u8]>

Source

pub fn get_buffer(&mut self, b: usize) -> Option<Buffer<'l>>

Source

pub fn get_vec(&mut self, b: usize) -> Option<Vec<u8>>

Source

pub fn get_be16(&mut self) -> Option<u16>

Source

pub fn get_be32(&mut self) -> Option<u32>

Source

pub fn get_ipv4(&mut self) -> Option<Ipv4Addr>

Source

pub fn get_tlv(&mut self) -> Option<(u8, &[u8])>

Source

pub fn get_domains(&mut self) -> Option<Vec<Vec<String>>>

Trait Implementations§

Source§

impl<'l> Display for Buffer<'l>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'l> Freeze for Buffer<'l>

§

impl<'l> RefUnwindSafe for Buffer<'l>

§

impl<'l> Send for Buffer<'l>

§

impl<'l> Sync for Buffer<'l>

§

impl<'l> Unpin for Buffer<'l>

§

impl<'l> UnsafeUnpin for Buffer<'l>

§

impl<'l> UnwindSafe for Buffer<'l>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.