Struct bstr::BStr [−][src]
#[repr(transparent)]pub struct BStr { /* fields omitted */ }
A wrapper for &[u8]
that provides convenient string oriented trait impls.
If you need ownership or a growable byte string buffer, then use
BString
.
Using a &BStr
is just like using a &[u8]
, since BStr
implements Deref
to [u8]
. So all methods available on [u8]
are also available on BStr
.
Representation
A &BStr
has the same representation as a &str
. That is, a &BStr
is
a fat pointer which consists of a pointer to some bytes and a length.
Trait implementations
The BStr
type has a number of trait implementations, and in particular,
defines equality and ordinal comparisons between &BStr
, &str
and
&[u8]
for convenience.
The Debug
implementation for BStr
shows its bytes as a normal string.
For invalid UTF-8, hex escape sequences are used.
The Display
implementation behaves as if BStr
were first lossily
converted to a str
. Invalid UTF-8 bytes are substituted with the Unicode
replacement codepoint, which looks like this: �.
Trait Implementations
impl AsMut<[u8]> for BStr
[src][+]
impl AsMut<BStr> for BString
[src][+]
impl AsMut<BStr> for [u8]
[src][+]
impl AsRef<[u8]> for BStr
[src][+]
impl AsRef<BStr> for BString
[src][+]
impl AsRef<BStr> for [u8]
[src][+]
impl AsRef<BStr> for str
[src][+]
impl Borrow<BStr> for BString
[src][+]
fn borrow(&self) -> &BStr
[src][−]
Immutably borrows from an owned value. Read more
impl Debug for BStr
[src][+]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src][−]
Formats the value using the given formatter. Read more
impl<'a> Default for &'a BStr
[src][+]
fn default() -> &'a BStr
[src][−]
Returns the “default value” for a type. Read more
impl<'a> Default for &'a mut BStr
[src][+]
fn default() -> &'a mut BStr
[src][−]
Returns the “default value” for a type. Read more
impl Deref for BStr
[src][+]
type Target = [u8]
The resulting type after dereferencing.
fn deref(&self) -> &[u8]
[src][−]
Dereferences the value.
impl DerefMut for BStr
[src][+]
fn deref_mut(&mut self) -> &mut [u8]
[src][−]
Mutably dereferences the value.
impl<'a, 'de: 'a> Deserialize<'de> for &'a BStr
[src][+]
fn deserialize<D>(deserializer: D) -> Result<&'a BStr, D::Error> where
D: Deserializer<'de>,
[src][−]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Display for BStr
[src][+]
fn fmt(&self, f: &mut Formatter<'_>) -> Result
[src][−]
Formats the value using the given formatter. Read more
impl Eq for BStr
[src]
impl<'a> From<&'a [u8]> for &'a BStr
[src][+]
impl<'a> From<&'a BStr> for BString
[src][+]
impl<'a> From<&'a BStr> for Cow<'a, BStr>
[src][+]
fn from(s: &'a BStr) -> Cow<'a, BStr>
[src][−]
Performs the conversion.
impl<'a> From<&'a str> for &'a BStr
[src][+]
impl<'a> FromIterator<&'a BStr> for BString
[src][+]
fn from_iter<T: IntoIterator<Item = &'a BStr>>(iter: T) -> BString
[src][−]
Creates a value from an iterator. Read more
impl Hash for BStr
[src][+]
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 Index<Range<usize>> for BStr
[src][+]
type Output = BStr
The returned type after indexing.
fn index(&self, r: Range<usize>) -> &BStr
[src][−]
Performs the indexing (container[index]
) operation.
impl Index<RangeFrom<usize>> for BStr
[src][+]
type Output = BStr
The returned type after indexing.
fn index(&self, r: RangeFrom<usize>) -> &BStr
[src][−]
Performs the indexing (container[index]
) operation.
impl Index<RangeFull> for BStr
[src][+]
type Output = BStr
The returned type after indexing.
fn index(&self, _: RangeFull) -> &BStr
[src][−]
Performs the indexing (container[index]
) operation.
impl Index<RangeInclusive<usize>> for BStr
[src][+]
type Output = BStr
The returned type after indexing.
fn index(&self, r: RangeInclusive<usize>) -> &BStr
[src][−]
Performs the indexing (container[index]
) operation.
impl Index<RangeTo<usize>> for BStr
[src][+]
type Output = BStr
The returned type after indexing.
fn index(&self, r: RangeTo<usize>) -> &BStr
[src][−]
Performs the indexing (container[index]
) operation.
impl Index<RangeToInclusive<usize>> for BStr
[src][+]
type Output = BStr
The returned type after indexing.
fn index(&self, r: RangeToInclusive<usize>) -> &BStr
[src][−]
Performs the indexing (container[index]
) operation.
impl Index<usize> for BStr
[src][+]
type Output = u8
The returned type after indexing.
fn index(&self, idx: usize) -> &u8
[src][−]
Performs the indexing (container[index]
) operation.
impl IndexMut<Range<usize>> for BStr
[src][+]
fn index_mut(&mut self, r: Range<usize>) -> &mut BStr
[src][−]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<RangeFrom<usize>> for BStr
[src][+]
fn index_mut(&mut self, r: RangeFrom<usize>) -> &mut BStr
[src][−]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<RangeFull> for BStr
[src][+]
fn index_mut(&mut self, _: RangeFull) -> &mut BStr
[src][−]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<RangeInclusive<usize>> for BStr
[src][+]
fn index_mut(&mut self, r: RangeInclusive<usize>) -> &mut BStr
[src][−]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<RangeTo<usize>> for BStr
[src][+]
fn index_mut(&mut self, r: RangeTo<usize>) -> &mut BStr
[src][−]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<RangeToInclusive<usize>> for BStr
[src][+]
fn index_mut(&mut self, r: RangeToInclusive<usize>) -> &mut BStr
[src][−]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<usize> for BStr
[src][+]
fn index_mut(&mut self, idx: usize) -> &mut u8
[src][−]
Performs the mutable indexing (container[index]
) operation.
impl Ord for BStr
[src][+]
fn cmp(&self, other: &BStr) -> Ordering
[src][−]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src][−]
Compares and returns the maximum of two values. Read more
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src][−]
Compares and returns the minimum of two values. Read more
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src][−]
Restrict a value to a certain interval. Read more
impl<'a, 'b> PartialEq<&'a [u8]> for BStr
[src][+]
fn eq(&self, other: &&'a [u8]) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<&'a BStr> for BString
[src][+]
fn eq(&self, other: &&'a BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<&'a BStr> for Vec<u8>
[src][+]
fn eq(&self, other: &&'a BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<&'a BStr> for String
[src][+]
fn eq(&self, other: &&'a BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<&'a BStr> for Cow<'a, BStr>
[src][+]
fn eq(&self, other: &&'a BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<&'a BStr> for Cow<'a, str>
[src][+]
fn eq(&self, other: &&'a BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<&'a BStr> for Cow<'a, [u8]>
[src][+]
fn eq(&self, other: &&'a BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<&'a str> for BStr
[src][+]
fn eq(&self, other: &&'a str) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<[u8]> for BStr
[src][+]
fn eq(&self, other: &[u8]) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<BStr> for BString
[src][+]
fn eq(&self, other: &BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl PartialEq<BStr> for BStr
[src][+]
fn eq(&self, other: &BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<BStr> for [u8]
[src][+]
fn eq(&self, other: &BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<BStr> for &'a [u8]
[src][+]
fn eq(&self, other: &BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<BStr> for str
[src][+]
fn eq(&self, other: &BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<BStr> for &'a str
[src][+]
fn eq(&self, other: &BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<BStr> for Vec<u8>
[src][+]
fn eq(&self, other: &BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<BStr> for String
[src][+]
fn eq(&self, other: &BStr) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<BString> for BStr
[src][+]
fn eq(&self, other: &BString) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<BString> for &'a BStr
[src][+]
fn eq(&self, other: &BString) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<Cow<'a, [u8]>> for &'a BStr
[src][+]
fn eq(&self, other: &Cow<'a, [u8]>) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<Cow<'a, BStr>> for &'a BStr
[src][+]
fn eq(&self, other: &Cow<'a, BStr>) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<Cow<'a, str>> for &'a BStr
[src][+]
fn eq(&self, other: &Cow<'a, str>) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<String> for BStr
[src][+]
fn eq(&self, other: &String) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<String> for &'a BStr
[src][+]
fn eq(&self, other: &String) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<Vec<u8, Global>> for BStr
[src][+]
fn eq(&self, other: &Vec<u8>) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<Vec<u8, Global>> for &'a BStr
[src][+]
fn eq(&self, other: &Vec<u8>) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialEq<str> for BStr
[src][+]
fn eq(&self, other: &str) -> bool
[src][−]
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests for !=
.
impl<'a, 'b> PartialOrd<&'a [u8]> for BStr
[src][+]
fn partial_cmp(&self, other: &&'a [u8]) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<&'a BStr> for BString
[src][+]
fn partial_cmp(&self, other: &&'a BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<&'a BStr> for Vec<u8>
[src][+]
fn partial_cmp(&self, other: &&'a BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<&'a BStr> for String
[src][+]
fn partial_cmp(&self, other: &&'a BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<&'a str> for BStr
[src][+]
fn partial_cmp(&self, other: &&'a str) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<[u8]> for BStr
[src][+]
fn partial_cmp(&self, other: &[u8]) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<BStr> for BString
[src][+]
fn partial_cmp(&self, other: &BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialOrd<BStr> for BStr
[src][+]
fn partial_cmp(&self, other: &BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<BStr> for [u8]
[src][+]
fn partial_cmp(&self, other: &BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<BStr> for &'a [u8]
[src][+]
fn partial_cmp(&self, other: &BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<BStr> for str
[src][+]
fn partial_cmp(&self, other: &BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<BStr> for &'a str
[src][+]
fn partial_cmp(&self, other: &BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<BStr> for Vec<u8>
[src][+]
fn partial_cmp(&self, other: &BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<BStr> for String
[src][+]
fn partial_cmp(&self, other: &BStr) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<BString> for BStr
[src][+]
fn partial_cmp(&self, other: &BString) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<BString> for &'a BStr
[src][+]
fn partial_cmp(&self, other: &BString) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<String> for BStr
[src][+]
fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<String> for &'a BStr
[src][+]
fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<Vec<u8, Global>> for BStr
[src][+]
fn partial_cmp(&self, other: &Vec<u8>) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<Vec<u8, Global>> for &'a BStr
[src][+]
fn partial_cmp(&self, other: &Vec<u8>) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> PartialOrd<str> for BStr
[src][+]
fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src][−]
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src][−]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Serialize for BStr
[src][+]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src][−]
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl ToOwned for BStr
[src][+]
type Owned = BString
The resulting type after obtaining ownership.
fn to_owned(&self) -> BString
[src][−]
Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut Self::Owned)
[src][−]
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Auto Trait Implementations
impl RefUnwindSafe for BStr
impl Send for BStr
impl !Sized for BStr
impl Sync for BStr
impl Unpin for BStr
impl UnwindSafe for BStr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
pub fn type_id(&self) -> TypeId
[src][−]
Gets the TypeId
of self
. Read more
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
pub fn borrow(&self) -> &T
[src][−]
Immutably borrows from an owned value. Read more
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src][−]
Mutably borrows from an owned value. Read more
impl<T> ToString for T where
T: Display + ?Sized,
[src][+]
T: Display + ?Sized,