Skip to main content

SliceInput

Struct SliceInput 

Source
pub struct SliceInput<'a> { /* private fields */ }
Expand description

A borrowed version of VecInput that tracks discard operations

Implementations§

Source§

impl<'a> SliceInput<'a>

Source

pub fn new(buf: &'a mut [u8]) -> Self

Create a new SliceInput from a mutable slice of bytes.

Source

pub fn into_used(self) -> usize

Returns how many bytes were consumed at the start of the original buffer.

Trait Implementations§

Source§

impl<'a> Debug for SliceInput<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl TlsInputBuffer for SliceInput<'_>

Source§

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

Return the buffer which contains the received data. Read more
Source§

fn discard(&mut self, num_bytes: usize)

Discard num_bytes from the front of the buffer returned by slice_mut(). Read more
Source§

fn received_close_notify(&mut self)

Signal that the connection has received a TLS close_notify alert. Read more
Source§

fn has_seen_eof(&self) -> bool

Whether the buffer has seen a TCP EOF. Read more

Auto Trait Implementations§

§

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

§

impl<'a> Freeze for SliceInput<'a>

§

impl<'a> RefUnwindSafe for SliceInput<'a>

§

impl<'a> Send for SliceInput<'a>

§

impl<'a> Sync for SliceInput<'a>

§

impl<'a> Unpin for SliceInput<'a>

§

impl<'a> UnsafeUnpin for SliceInput<'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.