Struct Limit
struct Limit<T> { ... }
A BufMut adapter which limits the amount of bytes that can be written
to an underlying buffer.
Implementations
impl<T> Limit<T>
fn into_inner(self: Self) -> TConsumes this
Limit, returning the underlying value.fn get_ref(self: &Self) -> &TGets a reference to the underlying
BufMut.It is inadvisable to directly write to the underlying
BufMut.fn get_mut(self: &mut Self) -> &mut TGets a mutable reference to the underlying
BufMut.It is inadvisable to directly write to the underlying
BufMut.fn limit(self: &Self) -> usizeReturns the maximum number of bytes that can be written
Note
If the inner
BufMuthas fewer bytes than indicated by this method then that is the actual number of available bytes.fn set_limit(self: &mut Self, lim: usize)Sets the maximum number of bytes that can be written.
Note
If the inner
BufMuthas fewer bytes thanlimthen that is the actual number of available bytes.
impl<T> Any for Limit<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Limit<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Limit<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> Freeze for Limit<T>
impl<T> From for Limit<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> RefUnwindSafe for Limit<T>
impl<T> Send for Limit<T>
impl<T> Sync for Limit<T>
impl<T> Unpin for Limit<T>
impl<T> UnsafeUnpin for Limit<T>
impl<T> UnwindSafe for Limit<T>
impl<T, U> Into for Limit<T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Limit<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Limit<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: $crate::fmt::Debug> Debug for Limit<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T: BufMut> BufMut for Limit<T>
fn remaining_mut(self: &Self) -> usizefn chunk_mut(self: &mut Self) -> &mut UninitSliceunsafe fn advance_mut(self: &mut Self, cnt: usize)