zlib_rs::read_buf

Struct ReadBuf

Source
pub struct ReadBuf<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> ReadBuf<'a>

Source

pub fn as_mut_ptr(&mut self) -> *mut u8

Pointer to the start of the ReadBuf

Source

pub fn capacity(&self) -> usize

Returns the total capacity of the buffer.

Source

pub fn len(&self) -> usize

Returns the length of the filled part of the buffer

Source

pub fn is_empty(&self) -> bool

Returns true if there are no bytes in this ReadBuf

Source

pub fn filled(&self) -> &[u8]

Returns a shared reference to the filled portion of the buffer.

Source

pub fn clear(&mut self)

Clears the buffer, resetting the filled region to empty.

The number of initialized bytes is not changed, and the contents of the buffer are not modified.

Source

pub fn push_lit(&mut self, byte: u8)

Source

pub fn push_dist(&mut self, dist: u16, len: u8)

Trait Implementations§

Source§

impl Debug for ReadBuf<'_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ReadBuf<'a>

§

impl<'a> RefUnwindSafe for ReadBuf<'a>

§

impl<'a> !Send for ReadBuf<'a>

§

impl<'a> !Sync for ReadBuf<'a>

§

impl<'a> Unpin for ReadBuf<'a>

§

impl<'a> !UnwindSafe for ReadBuf<'a>

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, 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.