Struct Buf
#[repr(transparent)]
pub struct Buf { pub inner: Vec<u8> }
Fields
inner: Vec<u8>
Implementations
impl Buf
fn into_encoded_bytes(self) -> Vec<u8>unsafe fn from_encoded_bytes_unchecked(s: Vec<u8>) -> Selffn into_string(self) -> Result<String, Buf>const fn from_string(s: String) -> Buffn with_capacity(capacity: usize) -> Buffn clear(&mut self)fn capacity(&self) -> usizefn push_slice(&mut self, s: &Slice)fn push_str(&mut self, s: &str)fn reserve(&mut self, additional: usize)fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>fn reserve_exact(&mut self, additional: usize)fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError>fn shrink_to_fit(&mut self)fn shrink_to(&mut self, min_capacity: usize)fn as_slice(&self) -> &Slicefn as_mut_slice(&mut self) -> &mut Slicefn leak<'a>(self) -> &'a mut Slicefn into_box(self) -> Box<Slice>fn from_box(boxed: Box<Slice>) -> Buffn into_arc(&self) -> Arc<Slice>fn into_rc(&self) -> Rc<Slice>unsafe fn truncate_unchecked(&mut self, len: usize)Provides plumbing to
Vec::truncatewithout giving full mutable access to theVec.Safety
The length must be at an
OsStrboundary, according toSlice::check_public_boundary.unsafe fn extend_from_slice_unchecked(&mut self, other: &[u8])Provides plumbing to
Vec::extend_from_slicewithout giving full mutable access to theVec.Safety
The slice must be valid for the platform encoding (as described in
OsStr::from_encoded_bytes_unchecked). This encoding has no safety requirements.
Trait Implementations
impl AsInner<[u8]> for Buf
fn as_inner(&self) -> &[u8]
impl Clone for Buf
fn clone(&self) -> Selffn clone_from(&mut self, source: &Self)
impl Debug for Buf
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for Buf
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl FromInner<Vec<u8>> for Buf
fn from_inner(inner: Vec<u8>) -> Self
impl Hash for Buf
fn hash<__H: Hasher>(&self, state: &mut __H)
impl IntoInner<Vec<u8>> for Buf
fn into_inner(self) -> Vec<u8>
Auto Trait Implementations
impl Freeze for Buf
impl RefUnwindSafe for Buf
impl Send for Buf
impl Sync for Buf
impl Unpin for Buf
impl UnsafeUnpin for Buf
impl UnwindSafe for Buf
Blanket Implementations
impl<T> Any for Buf
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Buf
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Buf
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Buf
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Buf
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for Buf
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for Buf
impl<T> ToOwned for Buf
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for Buf
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for Buf
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Buf
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for Buf
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>