pub struct NonZeroByteSlice(/* private fields */);Implementations§
Source§impl NonZeroByteSlice
impl NonZeroByteSlice
pub const fn new(bytes: &[u8]) -> Option<&NonZeroByteSlice>
Sourcepub const unsafe fn new_unchecked(bytes: &[u8]) -> &NonZeroByteSlice
pub const unsafe fn new_unchecked(bytes: &[u8]) -> &NonZeroByteSlice
§Safety
bytes- Must not contain0.
pub const fn into_inner(&self) -> &[u8] ⓘ
Trait Implementations§
Source§impl Borrow<NonZeroByteSlice> for NonZeroByteVec
impl Borrow<NonZeroByteSlice> for NonZeroByteVec
Source§fn borrow(&self) -> &NonZeroByteSlice
fn borrow(&self) -> &NonZeroByteSlice
Immutably borrows from an owned value. Read more
Source§impl Debug for NonZeroByteSlice
impl Debug for NonZeroByteSlice
Source§impl<'a> From<&'a CStr> for &'a NonZeroByteSlice
impl<'a> From<&'a CStr> for &'a NonZeroByteSlice
Source§fn from(s: &'a CStr) -> &'a NonZeroByteSlice
fn from(s: &'a CStr) -> &'a NonZeroByteSlice
Converts to this type from the input type.
Source§impl From<&NonZeroByteSlice> for NonZeroByteVec
impl From<&NonZeroByteSlice> for NonZeroByteVec
Source§fn from(slice: &NonZeroByteSlice) -> NonZeroByteVec
fn from(slice: &NonZeroByteSlice) -> NonZeroByteVec
Converts to this type from the input type.
Source§impl Hash for NonZeroByteSlice
impl Hash for NonZeroByteSlice
Source§impl PartialEq for NonZeroByteSlice
impl PartialEq for NonZeroByteSlice
Source§fn eq(&self, other: &NonZeroByteSlice) -> bool
fn eq(&self, other: &NonZeroByteSlice) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for NonZeroByteSlice
impl Serialize for NonZeroByteSlice
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl ToOwned for NonZeroByteSlice
impl ToOwned for NonZeroByteSlice
Source§type Owned = NonZeroByteVec
type Owned = NonZeroByteVec
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> <NonZeroByteSlice as ToOwned>::Owned
fn to_owned(&self) -> <NonZeroByteSlice as ToOwned>::Owned
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
Source§impl<'a> TryFrom<&'a str> for &'a NonZeroByteSlice
impl<'a> TryFrom<&'a str> for &'a NonZeroByteSlice
Source§type Error = NullByteError
type Error = NullByteError
The type returned in the event of a conversion error.
Source§fn try_from(
s: &'a str,
) -> Result<&'a NonZeroByteSlice, <&'a NonZeroByteSlice as TryFrom<&'a str>>::Error>
fn try_from( s: &'a str, ) -> Result<&'a NonZeroByteSlice, <&'a NonZeroByteSlice as TryFrom<&'a str>>::Error>
Performs the conversion.