Skip to main content

ByteStr

Struct ByteStr 

Source
#[repr(transparent)]
pub struct ByteStr(pub [u8]);

Tuple Fields§

§0: [u8]

Implementations§

Source§

impl ByteStr

Source

pub fn new(s: &[u8]) -> &ByteStr

Trait Implementations§

Source§

impl Borrow<ByteStr> for ByteString

Source§

fn borrow(&self) -> &ByteStr

Immutably borrows from an owned value. Read more
Source§

impl Debug for ByteStr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ByteStr

Source§

impl Hash for ByteStr

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
Source§

impl Ord for ByteStr

Source§

fn cmp(&self, other: &ByteStr) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl PartialEq for ByteStr

Source§

fn eq(&self, other: &ByteStr) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialEq<ByteString> for &ByteStr

Source§

fn eq(&self, other: &ByteString) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for ByteStr

Source§

fn partial_cmp(&self, other: &ByteStr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl RawString for &ByteStr

Source§

fn raw_string_bytes(&self) -> &[u8]

Source§

fn eq_ignore_trailing_spaces<R>(&self, other: &R) -> bool
where R: RawString,

Compares this string and other for equality, ignoring trailing ASCII spaces in either string for the purpose of comparison. (This is acceptable because we assume that the encoding is ASCII-compatible.) Read more
Source§

fn is_resizable(&self, new_len: usize) -> bool

Returns true if this raw string can be resized to len bytes without dropping non-space characters.
Source§

fn is_empty(&self) -> bool

Source§

fn is_spaces(&self) -> bool

Source§

fn len(&self) -> usize

Source§

fn as_ref(&self) -> &ByteStr

Source§

fn without_trailing_spaces(&self) -> &ByteStr

Source§

fn as_encoded(&self, encoding: &'static Encoding) -> WithEncoding<&ByteStr>
where Self: Sized,

Source§

fn with_encoding(self, encoding: &'static Encoding) -> WithEncoding<Self>
where Self: Sized,

Source§

impl Serialize for &ByteStr

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ByteStr

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.