[−][src]Struct bytestring::ByteString
An immutable UTF-8 encoded string with Bytes
as a storage.
Implementations
impl ByteString
[src]
pub const fn new() -> Self
[src]
Creates a new empty ByteString
.
pub fn as_bytes(&self) -> &Bytes
[src]
Get a reference to the underlying Bytes
object.
pub fn into_bytes(self) -> Bytes
[src]
Unwraps this ByteString
into the underlying Bytes
object.
pub const fn from_static(src: &'static str) -> ByteString
[src]
Creates a new ByteString
from a &'static str
.
pub const unsafe fn from_bytes_unchecked(src: Bytes) -> ByteString
[src]
Creates a new ByteString
from a Bytes.
Safety
This function is unsafe because it does not check the bytes passed to it are valid UTF-8.
If this constraint is violated, it may cause memory unsafety issues with future users of
the ByteString
, as we assume that ByteString
s are valid UTF-8. However, the most likely
issue is that the data gets corrupted.
Trait Implementations
impl AsRef<[u8]> for ByteString
[src]
impl AsRef<str> for ByteString
[src]
impl Borrow<str> for ByteString
[src]
impl Clone for ByteString
[src]
pub fn clone(&self) -> ByteString
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ByteString
[src]
impl Default for ByteString
[src]
pub fn default() -> ByteString
[src]
impl Deref for ByteString
[src]
impl Display for ByteString
[src]
impl Eq for ByteString
[src]
impl From<&'_ str> for ByteString
[src]
impl From<String> for ByteString
[src]
impl Hash for ByteString
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for ByteString
[src]
pub fn cmp(&self, other: &ByteString) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: AsRef<str>> PartialEq<T> for ByteString
[src]
impl PartialEq<str> for ByteString
[src]
pub fn eq(&self, other: &str) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<ByteString> for ByteString
[src]
pub fn partial_cmp(&self, other: &ByteString) -> Option<Ordering>
[src]
pub fn lt(&self, other: &ByteString) -> bool
[src]
pub fn le(&self, other: &ByteString) -> bool
[src]
pub fn gt(&self, other: &ByteString) -> bool
[src]
pub fn ge(&self, other: &ByteString) -> bool
[src]
impl StructuralEq for ByteString
[src]
impl TryFrom<&'_ [u8; 0]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 0]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 1]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 1]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 10]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 10]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 11]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 11]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 12]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 12]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 13]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 13]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 14]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 14]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 15]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 15]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 16]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 16]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 17]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 17]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 18]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 18]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 19]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 19]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 2]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 2]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 20]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 20]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 21]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 21]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 22]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 22]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 23]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 23]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 24]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 24]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 25]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 25]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 26]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 26]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 27]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 27]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 28]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 28]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 29]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 29]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 3]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 3]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 30]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 30]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 31]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 31]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 32]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 32]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 4]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 4]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 5]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 5]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 6]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 6]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 7]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 7]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 8]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 8]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8; 9]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8; 9]) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'_ [u8]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 0]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 0]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 1]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 1]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 10]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 10]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 11]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 11]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 12]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 12]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 13]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 13]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 14]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 14]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 15]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 15]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 16]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 16]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 17]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 17]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 18]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 18]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 19]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 19]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 2]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 2]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 20]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 20]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 21]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 21]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 22]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 22]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 23]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 23]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 24]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 24]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 25]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 25]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 26]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 26]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 27]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 27]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 28]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 28]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 29]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 29]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 3]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 3]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 30]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 30]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 31]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 31]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 32]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 32]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 4]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 4]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 5]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 5]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 6]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 6]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 7]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 7]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 8]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 8]) -> Result<Self, Self::Error>
[src]
impl TryFrom<[u8; 9]> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: [u8; 9]) -> Result<Self, Self::Error>
[src]
impl TryFrom<Bytes> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: Bytes) -> Result<Self, Self::Error>
[src]
impl TryFrom<BytesMut> for ByteString
[src]
type Error = Utf8Error
The type returned in the event of a conversion error.
pub fn try_from(value: BytesMut) -> Result<Self, Self::Error>
[src]
impl TryFrom<Vec<u8, Global>> for ByteString
[src]
Auto Trait Implementations
impl RefUnwindSafe for ByteString
[src]
impl Send for ByteString
[src]
impl Sync for ByteString
[src]
impl Unpin for ByteString
[src]
impl UnwindSafe for ByteString
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,