ByteStr

Struct ByteStr 

Source
pub struct ByteStr { /* private fields */ }
Expand description

Borrowed reference to a byte string. It provides similar functionality as str and [u8].

Implementations§

Source§

impl ByteStr

Source

pub fn empty<'a>() -> &'a Self

Creates an empty ByteStr.

Source

pub fn empty_mut<'a>() -> &'a mut Self

Creates an empty mutable ByteStr.

Source

pub fn from_slice(bytes: &[u8]) -> &Self

Creates a ByteStr from a byte slice.

Source

pub fn from_slice_mut(bytes: &mut [u8]) -> &mut Self

Create a mutable ByteStr from a byte slice.

Source

pub unsafe fn from_raw_parts<'a>(ptr: *const u8, len: usize) -> &'a Self

Forms a ByteStr from a pointer and a length.

Source

pub unsafe fn from_raw_parts_mut<'a>(ptr: *mut u8, len: usize) -> &'a mut Self

Forms a mutable ByteStr from a pointer and a length.

Source

pub fn as_slice(&self) -> &[u8]

Converts self into a byte slice.

Source

pub fn as_mut_slice(&mut self) -> &mut [u8]

Converts self into a mutable byte slice.

Source

pub fn to_vec(&self) -> Vec<u8>

Copies the self into a Vec.

Source

pub fn to_byte_string(&self) -> ByteString

Copies the self into a ByteString.

Source

pub fn into_boxed_slice(self: Box<Self>) -> Box<[u8]>

Converts self into a boxed slice without clones or allocation.

Source

pub fn into_vec(self: Box<Self>) -> Vec<u8>

Converts self into a vector without clones or allocation.

Source

pub fn into_byte_string(self: Box<Self>) -> ByteString

Converts self into a ByteString without clones or allocation.

Source

pub fn len(&self) -> usize

Returns the length of self.

Source

pub fn is_empty(&self) -> bool

Returns true if the length of self is zero.

Source

pub fn as_ptr(&self) -> *const u8

Converts self into a raw pointer that points to the first byte of the string.

Source

pub fn as_mut_ptr(&mut self) -> *mut u8

Converts self into a mutable raw pointer that points to the first byte of the string.

Source

pub fn get(&self, index: usize) -> Option<&u8>

Returns a reference to an element of the slice, or None if the index is out of bounds.

Source

pub fn get_mut(&mut self, index: usize) -> Option<&mut u8>

Returns a mutable reference to an element of the slice, or None if the index is out of bounds.

Source

pub fn first(&self) -> Option<&u8>

Returns a reference to the first byte of the string, or None if it is empty.

Source

pub fn first_mut(&mut self) -> Option<&mut u8>

Returns a mutable reference to the first byte of the string, or None if it is empty.

Source

pub fn last(&self) -> Option<&u8>

Returns a reference to the last byte of the string, or None if it is empty.

Source

pub fn last_mut(&mut self) -> Option<&mut u8>

Returns a mutable reference to the last byte of the string, or None if it is empty.

Source

pub fn split_first(&self) -> Option<(&u8, &ByteStr)>

Returns the first and all the rest of the bytes of the slice, or None if it is empty.

Source

pub fn split_first_mut(&mut self) -> Option<(&mut u8, &mut ByteStr)>

Returns the first and all the rest of the bytes of the slice, or None if it is empty.

Source

pub fn split_last(&self) -> Option<(&u8, &ByteStr)>

Returns the last and all the rest of the bytes of the slice, or None if it is empty.

Source

pub fn split_last_mut(&mut self) -> Option<(&mut u8, &mut ByteStr)>

Returns the last and all the rest of the bytes of the slice, or None if it is empty.

Source

pub fn iter<'a>(&'a self) -> Iter<'a, u8>

Returns an iterator over the string.

Source

pub fn iter_mut<'a>(&'a mut self) -> IterMut<'a, u8>

Returns an iterator that allows modifying each value.

Source

pub fn windows<'a>(&'a self, size: usize) -> Windows<'a>

Returns an iterator over all contiguous windows of length size. The windows overlap. If the string is shorter than size, the iterator returns no values.

Similar to slice::windows().

Source

pub fn chunks<'a>(&'a self, size: usize) -> Chunks<'a>

Returns an iterator over size bytes of the string at a time. The chunks do not overlap. If size does not divide the length of the slice, then the last chunk will not have length size.

Similar to slice::chunks().

Source

pub fn chunks_mut<'a>(&'a mut self, size: usize) -> ChunksMut<'a>

Returns an iterator over size elements of the slice at a time. The chunks are mutable strings and do not overlap. If size does not divide the length of the slice, then the last chunk will not have length size.

Similar to slice::chunks_mut().

Source

pub fn split_at(&self, mid: usize) -> (&ByteStr, &ByteStr)

Divides one string into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

Similar to slice::split_at().

§Panics

Panics if mid > len.

Source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut ByteStr, &mut ByteStr)

Divides one &mut string into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

Similar to slice::split_at_mut().

§Panics

Panics if mid > len.

Source

pub fn split<'a, M: IntoMatcher>(&'a self, m: M) -> Split<'a, M::Matcher>

Returns an iterator over substrings of this string, separated by a matcher.

Source

pub fn split_mut<'a, M: IntoMatcher>( &'a mut self, m: M, ) -> SplitMut<'a, M::Matcher>

Returns an iterator over mutable substrings of this string, separated by a matcher.

Source

pub fn rsplit<'a, M: IntoMatcher>(&'a self, m: M) -> RSplit<'a, M::Matcher>

Returns an iterator over substrings of this string, separated by a matcher, starting at the end of the slice and working backwards.

Source

pub fn rsplit_mut<'a, M: IntoMatcher>( &'a mut self, m: M, ) -> RSplitMut<'a, M::Matcher>

Returns an iterator over mutable substrings of this string, separated by a matcher, starting at the end of the slice and working backwards.

Source

pub fn splitn<'a, M: IntoMatcher>( &'a self, n: usize, m: M, ) -> SplitN<'a, M::Matcher>

Returns an iterator over substrings of this string, separated by a matcher, returning at most n items.

If n substrings are returned, the last substring will contain the remainder of the string.

Source

pub fn splitn_mut<'a, M: IntoMatcher>( &'a mut self, n: usize, m: M, ) -> SplitNMut<'a, M::Matcher>

Returns an iterator over mutable substrings of this string, separated by a matcher, returning at most n items.

If n substrings are returned, the last substring will contain the remainder of the string.

Source

pub fn rsplitn<'a, M: IntoMatcher>( &'a self, n: usize, m: M, ) -> RSplitN<'a, M::Matcher>

Returns an iterator over substrings of this string, separated by a matcher and stating from the end of the string, returning at most n items.

If n substrings are returned, the last substring will contain the remainder of the string.

Source

pub fn rsplitn_mut<'a, M: IntoMatcher>( &'a mut self, n: usize, m: M, ) -> RSplitNMut<'a, M::Matcher>

Returns an iterator over mutable substrings of this string, separated by a matcher and stating from the end of the string, returning at most n items.

If n substrings are returned, the last substring will contain the remainder of the string.

Source

pub fn matches<'a, M: IntoMatcher>(&'a self, m: M) -> Matches<'a, M::Matcher>

Returns an iterator over the disjoint matches within the given string.

Source

pub fn matches_mut<'a, M: IntoMatcher>( &'a mut self, m: M, ) -> MatchesMut<'a, M::Matcher>

Returns an iterator over the mutable disjoint matches within the given string.

Source

pub fn rmatches<'a, M: IntoMatcher>(&'a self, m: M) -> RMatches<'a, M::Matcher>

Returns an iterator over the disjoint matches within the given string, yielded in reverse order.

Source

pub fn rmatches_mut<'a, M: IntoMatcher>( &'a mut self, m: M, ) -> RMatchesMut<'a, M::Matcher>

Returns an iterator over the mutable disjoint matches within the given string, yielded in reverse order.

Source

pub fn match_indices<'a, M: IntoMatcher>( &'a self, m: M, ) -> MatchIndices<'a, M::Matcher>

Returns an iterator over the disjoint matches within the given string, as well as the index that the match starts at.

Source

pub fn match_indices_mut<'a, M: IntoMatcher>( &'a mut self, m: M, ) -> MatchIndicesMut<'a, M::Matcher>

Returns an iterator over the mutable disjoint matches within the given string, as well as the index that the match starts at.

Source

pub fn rmatch_indices<'a, M: IntoMatcher>( &'a self, m: M, ) -> RMatchIndices<'a, M::Matcher>

Returns an iterator over the disjoint matches within the given string, yielded in reverse order, as well as the index that the match starts at.

Source

pub fn rmatch_indices_mut<'a, M: IntoMatcher>( &'a mut self, m: M, ) -> RMatchIndicesMut<'a, M::Matcher>

Returns an iterator over the mutable disjoint matches within the given string, yielded in reverse order, as well as the index that the match starts at.

Source

pub fn contains<M: IntoMatcher>(&self, m: M) -> bool

Returns true if the string contains a substring that matches the given matcher.

Source

pub fn starts_with<M: IntoMatcher>(&self, m: M) -> bool

Returns true if the string beginning a matches the given matcher.

Source

pub fn ends_with<M: IntoMatcher>(&self, m: M) -> bool

Returns true if the string ending a matches the given matcher.

Source

pub fn find<M: IntoMatcher>(&self, m: M) -> Option<usize>

Returns the byte index of the first character of self that matches the matcher or None it it doesn’t match.

Source

pub fn rfind<M: IntoMatcher>(&self, m: M) -> Option<usize>

Returns the byte index of the last character of self that matches the matcher or None it it doesn’t match.

Source

pub fn swap(&mut self, a: usize, b: usize)

Swaps two bytes in the string, indexed by a and b.

§Panics

Panics if a or b are out of bounds.

Source

pub fn reverse(&mut self)

Reverses the order of bytes in the slice.

Source

pub fn copy_from_slice(&mut self, src: &[u8])

Copies all elements from src into self, using a memcpy.

The length of src must be the same as self.

Source

pub fn copy_from_byte_str(&mut self, src: &ByteStr)

Copies all elements from src into self, using a memcpy.

The length of src must be the same as self.

Trait Implementations§

Source§

impl AsMut<[u8]> for ByteStr

Source§

fn as_mut(&mut self) -> &mut [u8]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsMut<ByteStr> for ByteStr

Source§

fn as_mut(&mut self) -> &mut ByteStr

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsMut<ByteStr> for ByteString

Source§

fn as_mut(&mut self) -> &mut ByteStr

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<[u8]> for ByteStr

Source§

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

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<ByteStr> for ByteStr

Source§

fn as_ref(&self) -> &ByteStr

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<ByteStr> for ByteString

Source§

fn as_ref(&self) -> &ByteStr

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<ByteStr> for ByteString

Source§

fn borrow(&self) -> &ByteStr

Immutably borrows from an owned value. Read more
Source§

impl BorrowMut<ByteStr> for ByteString

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl Debug for ByteStr

Source§

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

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

impl<'a> Default for &'a ByteStr

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a> Default for &'a mut ByteStr

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a> From<&'a ByteStr> for ByteString

Source§

fn from(src: &'a ByteStr) -> Self

Converts to this type from the input type.
Source§

impl Index<Range<usize>> for ByteStr

Source§

type Output = ByteStr

The returned type after indexing.
Source§

fn index(&self, index: Range<usize>) -> &ByteStr

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<RangeFrom<usize>> for ByteStr

Source§

type Output = ByteStr

The returned type after indexing.
Source§

fn index(&self, index: RangeFrom<usize>) -> &ByteStr

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<RangeFull> for ByteStr

Source§

type Output = ByteStr

The returned type after indexing.
Source§

fn index(&self, index: RangeFull) -> &ByteStr

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<RangeTo<usize>> for ByteStr

Source§

type Output = ByteStr

The returned type after indexing.
Source§

fn index(&self, index: RangeTo<usize>) -> &ByteStr

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<usize> for ByteStr

Source§

type Output = u8

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &u8

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<Range<usize>> for ByteStr

Source§

fn index_mut(&mut self, index: Range<usize>) -> &mut ByteStr

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<RangeFrom<usize>> for ByteStr

Source§

fn index_mut(&mut self, index: RangeFrom<usize>) -> &mut ByteStr

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<RangeFull> for ByteStr

Source§

fn index_mut(&mut self, index: RangeFull) -> &mut ByteStr

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<RangeTo<usize>> for ByteStr

Source§

fn index_mut(&mut self, index: RangeTo<usize>) -> &mut ByteStr

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for ByteStr

Source§

fn index_mut(&mut self, index: usize) -> &mut u8

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a> IntoIterator for &'a ByteStr

Source§

type Item = &'a u8

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, u8>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a> IntoIterator for &'a mut ByteStr

Source§

type Item = &'a mut u8

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, u8>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, T: ?Sized> PartialEq<&'a T> for ByteStr
where ByteStr: PartialEq<T>,

Source§

fn eq(&self, other: &&'a T) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8]> for ByteStr

Source§

fn eq(&self, other: &[u8]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 0]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 0]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 0]> for ByteStr

Source§

fn eq(&self, other: &[u8; 0]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 1]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 1]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 1]> for ByteStr

Source§

fn eq(&self, other: &[u8; 1]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 10]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 10]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 10]> for ByteStr

Source§

fn eq(&self, other: &[u8; 10]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 11]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 11]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 11]> for ByteStr

Source§

fn eq(&self, other: &[u8; 11]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 12]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 12]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 12]> for ByteStr

Source§

fn eq(&self, other: &[u8; 12]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 13]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 13]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 13]> for ByteStr

Source§

fn eq(&self, other: &[u8; 13]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 14]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 14]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 14]> for ByteStr

Source§

fn eq(&self, other: &[u8; 14]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 15]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 15]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 15]> for ByteStr

Source§

fn eq(&self, other: &[u8; 15]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 16]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 16]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 16]> for ByteStr

Source§

fn eq(&self, other: &[u8; 16]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 17]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 17]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 17]> for ByteStr

Source§

fn eq(&self, other: &[u8; 17]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 18]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 18]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 18]> for ByteStr

Source§

fn eq(&self, other: &[u8; 18]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 19]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 19]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 19]> for ByteStr

Source§

fn eq(&self, other: &[u8; 19]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 2]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 2]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 2]> for ByteStr

Source§

fn eq(&self, other: &[u8; 2]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 20]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 20]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 20]> for ByteStr

Source§

fn eq(&self, other: &[u8; 20]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 21]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 21]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 21]> for ByteStr

Source§

fn eq(&self, other: &[u8; 21]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 22]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 22]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 22]> for ByteStr

Source§

fn eq(&self, other: &[u8; 22]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 23]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 23]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 23]> for ByteStr

Source§

fn eq(&self, other: &[u8; 23]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 24]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 24]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 24]> for ByteStr

Source§

fn eq(&self, other: &[u8; 24]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 25]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 25]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 25]> for ByteStr

Source§

fn eq(&self, other: &[u8; 25]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 26]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 26]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 26]> for ByteStr

Source§

fn eq(&self, other: &[u8; 26]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 27]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 27]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 27]> for ByteStr

Source§

fn eq(&self, other: &[u8; 27]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 28]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 28]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 28]> for ByteStr

Source§

fn eq(&self, other: &[u8; 28]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 29]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 29]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 29]> for ByteStr

Source§

fn eq(&self, other: &[u8; 29]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 3]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 3]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 3]> for ByteStr

Source§

fn eq(&self, other: &[u8; 3]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 30]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 30]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 30]> for ByteStr

Source§

fn eq(&self, other: &[u8; 30]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 31]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 31]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 31]> for ByteStr

Source§

fn eq(&self, other: &[u8; 31]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 32]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 32]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 32]> for ByteStr

Source§

fn eq(&self, other: &[u8; 32]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 4]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 4]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 4]> for ByteStr

Source§

fn eq(&self, other: &[u8; 4]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 5]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 5]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 5]> for ByteStr

Source§

fn eq(&self, other: &[u8; 5]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 6]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 6]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 6]> for ByteStr

Source§

fn eq(&self, other: &[u8; 6]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 7]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 7]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 7]> for ByteStr

Source§

fn eq(&self, other: &[u8; 7]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 8]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 8]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 8]> for ByteStr

Source§

fn eq(&self, other: &[u8; 8]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<[u8; 9]> for &'a ByteStr

Source§

fn eq(&self, other: &[u8; 9]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 9]> for ByteStr

Source§

fn eq(&self, other: &[u8; 9]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<ByteStr> for &'a ByteStr

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialEq<ByteString> for &'a ByteStr

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<ByteString> for ByteStr

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> PartialEq<Cow<'b, ByteStr>> for &'a ByteStr

Source§

fn eq(&self, other: &Cow<'b, ByteStr>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'b> PartialEq<Cow<'b, ByteStr>> for ByteStr

Source§

fn eq(&self, other: &Cow<'b, ByteStr>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for ByteStr

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToOwned for ByteStr

Source§

type Owned = ByteString

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> ByteString

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl Eq for ByteStr

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