pub struct BString(/* private fields */);Expand description
A binary string. The owned counterpart to BStr.
Implementations§
Source§impl BString
impl BString
Sourcepub fn from(s: impl Into<Vec<u8>>) -> Self
pub fn from(s: impl Into<Vec<u8>>) -> Self
Construct from anything which can be converted into a byte buffer.
Sourcepub fn into_inner(self) -> Vec<u8> ⓘ
pub fn into_inner(self) -> Vec<u8> ⓘ
Unwrap into a byte buffer.
Sourcepub const fn as_mut_vec(&mut self) -> &mut Vec<u8> ⓘ
pub const fn as_mut_vec(&mut self) -> &mut Vec<u8> ⓘ
Mutably-borrow the underlying byte buffer.
Sourcepub const fn into_cow(self) -> Cow<'static, BStr>
pub const fn into_cow(self) -> Cow<'static, BStr>
Wrap in a Cow::Owned.
Trait Implementations§
impl Eq for BString
Source§impl IntoZString<'static> for BString
impl IntoZString<'static> for BString
Source§impl Ord for BString
impl Ord for BString
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: AsRef<[u8]> + ?Sized> PartialOrd<T> for BString
impl<T: AsRef<[u8]> + ?Sized> PartialOrd<T> for BString
Auto Trait Implementations§
impl Freeze for BString
impl RefUnwindSafe for BString
impl Send for BString
impl Sync for BString
impl Unpin for BString
impl UnsafeUnpin for BString
impl UnwindSafe for BString
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