#[repr(transparent)]pub struct Buf {
pub inner: Vec<u8>,
}
Fields§
§inner: Vec<u8>
Implementations§
Source§impl Buf
impl Buf
pub fn into_encoded_bytes(self) -> Vec<u8> ⓘ
pub unsafe fn from_encoded_bytes_unchecked(s: Vec<u8>) -> Self
pub fn into_string(self) -> Result<String, Buf>
pub fn from_string(s: String) -> Buf
pub fn with_capacity(capacity: usize) -> Buf
pub fn clear(&mut self)
pub fn capacity(&self) -> usize
pub fn push_slice(&mut self, s: &Slice)
pub fn push_str(&mut self, s: &str)
pub fn reserve(&mut self, additional: usize)
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn reserve_exact(&mut self, additional: usize)
pub fn try_reserve_exact( &mut self, additional: usize, ) -> Result<(), TryReserveError>
pub fn shrink_to_fit(&mut self)
pub fn shrink_to(&mut self, min_capacity: usize)
pub fn as_slice(&self) -> &Slice
pub fn as_mut_slice(&mut self) -> &mut Slice
pub fn leak<'a>(self) -> &'a mut Slice
pub fn into_box(self) -> Box<Slice>
pub fn from_box(boxed: Box<Slice>) -> Buf
pub fn into_arc(&self) -> Arc<Slice>
pub fn into_rc(&self) -> Rc<Slice>
Sourcepub unsafe fn truncate_unchecked(&mut self, len: usize)
pub unsafe fn truncate_unchecked(&mut self, len: usize)
Provides plumbing to Vec::truncate
without giving full mutable access
to the Vec
.
§Safety
The length must be at an OsStr
boundary, according to
Slice::check_public_boundary
.
Sourcepub unsafe fn extend_from_slice_unchecked(&mut self, other: &[u8])
pub unsafe fn extend_from_slice_unchecked(&mut self, other: &[u8])
Provides plumbing to Vec::extend_from_slice
without giving full
mutable access to the Vec
.
§Safety
This encoding has no safety requirements.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Buf
impl RefUnwindSafe for Buf
impl Send for Buf
impl Sync for Buf
impl Unpin for Buf
impl UnwindSafe for Buf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)The largest safe length for a
[Self]
. Read more