Struct bstring::bstring::bstr
[−]
[src]
pub struct bstr { /* fields omitted */ }
Byte string slice of unknown encoding.
It is analogous to the standard str
type.
Its owned counterpart is the BString
type.
Methods
impl bstr
[src]
unsafe fn from_raw_parts<'a>(ptr: *const u8, length: usize) -> &'a bstr
Creates a new &bstr
slice from a pointer and length.
Safety
This function is unsafe as there is no guarantee that the given
pointer is valid for length
bytes, nor whether the the lifetime
inferred is a suitable lifetime for the returned slice.
unsafe fn from_raw_parts_mut<'a>(ptr: *mut u8, len: usize) -> &'a mut bstr
Creates a new &mut bstr
slice from a pointer and length.
Safety
This function is unsafe as there is no guarantee that the given
pointer is valid for length
bytes, nor whether the the lifetime
inferred is a suitable lifetime for the returned slice.
fn len(&self) -> usize
Returns the length of the string, in bytes.
fn is_empty(&self) -> bool
Returns whether the string is empty.
fn as_bytes(&self) -> &[u8]
Returns a borrowed reference to the internal byte slice.
fn as_mut_bytes(&mut self) -> &mut [u8]
Returns a mutable reference to the internal byte slice.
fn as_ptr(&self) -> *const u8
Returns a raw pointer to the contained buffer.
fn as_mut_ptr(&mut self) -> *mut u8
Returns a raw mutable pointer to the contained buffer.
fn to_bstring(&self) -> BString
Returns a newly allocated BString
buffer for the
fn to_str(&self) -> Result<&str, Utf8Error>
Attempts to convert the byte string to a str
slice.
If the byte string does not contain valid UTF-8, an error is returned.
unsafe fn to_str_unchecked(&self) -> &str
fn to_string_lossy(&self) -> Cow<str>
Converts the byte string a String
.
During this conversion, any invalid UTF-8 sequences will be replaced
with U+FFFD REPLACEMENT CHARACTER
, which looks like this �
fn display(&self) -> Display
Returns an object that implements Display
for safely printing
byte strings that may contain non-UTF-8 data.
fn get(&self, idx: usize) -> Option<&u8>
Returns the byte at the given index.
Returns None
if idx
is greater than or equal to the string length.
unsafe fn get_unchecked(&self, idx: usize) -> &u8
Returns the byte at the given index, bypassing bounds-checking.
Safety
The caller of this function must guarantee that idx
is less than
the byte string length.
unsafe fn slice_unchecked(&self, start: usize, end: usize) -> &bstr
Returns a subslice of this byte string, bypassing bounds-checking.
Safety
The caller of this function must guarantee that:
start
is less than or equal toend
end
is less than or equal to the byte string length
unsafe fn slice_mut_unchecked(&mut self, start: usize, end: usize) -> &mut bstr
Returns a mutable subslice of this byte string, bypassing bounds-checking.
Safety
The caller of this function must guarantee that:
start
is less than or equal toend
end
is less than or equal to the byte string length
fn first(&self) -> Option<&u8>
Returns a borrowed reference to the first byte in the string.
Returns None
if the byte string is empty.
fn first_mut(&mut self) -> Option<&mut u8>
Returns a mutable reference to the first byte in the string.
Returns None
if the byte string is empty.
fn last(&self) -> Option<&u8>
Returns a borrowed reference to the last byte in the string.
Returns None
if the byte string is empty.
fn last_mut(&mut self) -> Option<&mut u8>
Returns a mutable reference to the last byte in the string.
Returns None
if the byte string is empty.
fn iter(&self) -> Iter
Returns an iterator over the bytes of this string.
The element type of the returned iterator is &u8
.
fn iter_mut(&mut self) -> IterMut
Returns a mutable iterator over the bytes of this string.
The element type of the returned iterator is &mut u8
.
fn lines(&self) -> Lines
Returns an iterator over the lines of this byte string.
Lines may end with either a newline (\n
)
or a carriage return followed by a line feed (\r\n
).
Yielded subslices will not contain the line ending.
fn trim(&self) -> &bstr
Returns a subslice with leading and trailing whitespace removed.
fn trim_left(&self) -> &bstr
Returns a subslice with leading whitespace removed.
fn trim_right(&self) -> &bstr
Returns a subslice with trailing whitespace removed.
fn trim_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &bstr where
P::Searcher: DoubleEndedSearcher<'a>,
P::Searcher: DoubleEndedSearcher<'a>,
Returns a subslice with all matching prefixes and suffixes removed.
fn trim_left_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &bstr
Returns a subslice with all matching prefixes removed.
fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &bstr where
P::Searcher: ReverseSearcher<'a>,
P::Searcher: ReverseSearcher<'a>,
Returns a subslice with all matching suffixes removed.
fn partition<'a, P: Pattern<'a>>(
&'a self,
pat: P
) -> Option<(&'a bstr, &'a bstr)>
&'a self,
pat: P
) -> Option<(&'a bstr, &'a bstr)>
Partitions the string using the given pattern.
The string is searched for the given pattern. If it is found, two subslices are returned: The portion of the string before the matching substring and the portion occurring after it.
Examples
use bstring::bstr; let bs = <&bstr>::from("foo=bar=baz"); let (a, b) = bs.partition(b'=').unwrap(); assert_eq!(a, "foo"); assert_eq!(b, "bar=baz");
fn rpartition<'a, P: Pattern<'a>>(
&'a self,
pat: P
) -> Option<(&'a bstr, &'a bstr)> where
P::Searcher: ReverseSearcher<'a>,
&'a self,
pat: P
) -> Option<(&'a bstr, &'a bstr)> where
P::Searcher: ReverseSearcher<'a>,
Partitions the string using the given pattern, searching from the end.
The string is searched for the given pattern, starting from the end. If it is found, two subslices are returned: The portion of the string before the matching substring and the portion occurring after it.
Examples
use bstring::bstr; let bs = <&bstr>::from("foo=bar=baz"); let (a, b) = bs.rpartition(b'=').unwrap(); assert_eq!(a, "foo=bar"); assert_eq!(b, "baz");
fn split<'a, P: Pattern<'a>>(&'a self, pat: P) -> Split<'a, P>
Returns an iterator of subslices of this string, separated by a pattern.
fn rsplit<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplit<'a, P>
Returns a reverse iterator of subslices of this string, separated by a pattern.
fn splitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> SplitN<'a, P>
Returns an iterator of subslices of this string, separated by a pattern,
limited to at most count
items.
If count
items are returned, the last item will contain the remainder
of the string.
fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a, P> where
P::Searcher: ReverseSearcher<'a>,
P::Searcher: ReverseSearcher<'a>,
Returns a reverse iterator of subslices of this string,
separated by a pattern, limited to at most count
items.
If count
items are returned, the last item will contain the remainder
of the string.
fn split_terminator<'a, P: Pattern<'a>>(
&'a self,
pat: P
) -> SplitTerminator<'a, P>
&'a self,
pat: P
) -> SplitTerminator<'a, P>
Returns an iterator of subslices of this string, separated by a pattern.
Equivalent to split
, except that the final subslice is skipped if
it is empty.
fn rsplit_terminator<'a, P: Pattern<'a>>(
&'a self,
pat: P
) -> RSplitTerminator<'a, P> where
P::Searcher: ReverseSearcher<'a>,
&'a self,
pat: P
) -> RSplitTerminator<'a, P> where
P::Searcher: ReverseSearcher<'a>,
Returns a reverse iterator of subslices of this string, separated by a pattern.
Equivalent to rsplit
, except that the final subslice is skipped if
it is empty.
fn split_words<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitWords<'a, P>
Returns an iterator of delimited words.
This differs from split
in that multiple occurances of a pattern
will be considered as one.
Examples
use bstring::bstr; let mut words = <&bstr>::from(" foo bar ").split_words(b' '); assert_eq!(words.next().unwrap(), "foo"); assert_eq!(words.next().unwrap(), "bar"); assert_eq!(words.next(), None);
fn matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> Matches<'a, P>
Returns an iterator over matches in the byte string.
fn rmatches<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatches<'a, P>
Returns a reverse iterator over matches in the byte string.
fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P>
Returns an iterator over matches in the byte string, including the index at which the match begins.
fn rmatch_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatchIndices<'a, P>
Returns a reverse iterator over matches in the byte string, including the index at which the match begins.
fn split_at(&self, mid: usize) -> (&bstr, &bstr)
Returns the byte string divided into two at mid
.
Panics
If mid
is beyond the end of the byte string.
fn split_at_mut(&mut self, mid: usize) -> (&mut bstr, &mut bstr)
Returns the byte string divided into two at mid
.
Panics
If mid
is beyond the end of the byte string.
fn split_first(&self) -> Option<(&u8, &bstr)>
Returns the first byte and the rest,
or None
if the byte string is empty.
fn split_first_mut(&mut self) -> Option<(&mut u8, &mut bstr)>
Returns the first byte and the rest,
or None
if the byte string is empty.
fn split_last(&self) -> Option<(&u8, &bstr)>
Returns the last byte and the rest,
or None
if the byte string is empty.
fn split_last_mut(&mut self) -> Option<(&mut u8, &mut bstr)>
Returns the last byte and the rest,
or None
if the byte string is empty.
fn contains<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool
Returns whether the byte string contains the given pattern.
fn starts_with<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool
Returns whether the byte string starts with the given pattern.
fn ends_with<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool where
P::Searcher: ReverseSearcher<'a>,
P::Searcher: ReverseSearcher<'a>,
Returns whether the byte string ends with the given pattern.
fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize>
Returns the index of the first match of the given pattern.
Returns None
if there is no match.
fn rfind<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize> where
P::Searcher: ReverseSearcher<'a>,
P::Searcher: ReverseSearcher<'a>,
Returns the index of the first match of the given pattern, starting from the end.
Returns None
if there is no match.
fn parse<F: FromBStr>(&self) -> Result<F, F::Err>
Returns a value parsed from the byte string,
using the FromBStr
trait
fn into_bstring(self: Box<bstr>) -> BString
Converts a Box<bstr>
into a BString
.
Trait Implementations
impl Display for bstr
[src]
impl<'a> From<&'a str> for &'a bstr
[src]
impl<'a> From<&'a [u8]> for &'a bstr
[src]
impl AsRef<bstr> for bstr
[src]
impl AsMut<bstr> for bstr
[src]
impl Debug for bstr
[src]
impl Hash for bstr
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a> Default for &'a bstr
[src]
impl ToOwned for bstr
[src]
type Owned = BString
fn to_owned(&self) -> BString
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut Self::Owned)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl Index<usize> for bstr
[src]
type Output = u8
The returned type after indexing
fn index(&self, idx: usize) -> &u8
The method for the indexing (container[index]
) operation
impl Index<Range<usize>> for bstr
[src]
type Output = bstr
The returned type after indexing
fn index(&self, r: Range<usize>) -> &bstr
The method for 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
The method for 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
The method for the indexing (container[index]
) operation
impl Index<RangeFull> for bstr
[src]
type Output = bstr
The returned type after indexing
fn index(&self, r: RangeFull) -> &bstr
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for bstr
[src]
fn index_mut(&mut self, idx: usize) -> &mut u8
The method for the mutable indexing (container[index]
) operation
impl IndexMut<Range<usize>> for bstr
[src]
fn index_mut(&mut self, r: Range<usize>) -> &mut bstr
The method for the mutable indexing (container[index]
) operation
impl IndexMut<RangeFrom<usize>> for bstr
[src]
fn index_mut(&mut self, r: RangeFrom<usize>) -> &mut bstr
The method for the mutable indexing (container[index]
) operation
impl IndexMut<RangeTo<usize>> for bstr
[src]
fn index_mut(&mut self, r: RangeTo<usize>) -> &mut bstr
The method for the mutable indexing (container[index]
) operation
impl IndexMut<RangeFull> for bstr
[src]
fn index_mut(&mut self, r: RangeFull) -> &mut bstr
The method for the mutable indexing (container[index]
) operation
impl<'a> IntoIterator for &'a bstr
[src]
type Item = &'a u8
The type of the elements being iterated over.
type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<'a> IntoIterator for &'a mut bstr
[src]
type Item = &'a mut u8
The type of the elements being iterated over.
type IntoIter = IterMut<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl Eq for bstr
[src]
impl<'a, 'b> PartialEq<bstr> for bstr
[src]
fn eq(&self, rhs: &bstr) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &bstr) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<BString> for bstr
[src]
fn eq(&self, rhs: &BString) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &BString) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<Cow<'a, bstr>> for bstr
[src]
fn eq(&self, rhs: &Cow<'a, bstr>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &Cow<'a, bstr>) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<str> for bstr
[src]
fn eq(&self, rhs: &str) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &str) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<String> for bstr
[src]
fn eq(&self, rhs: &String) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &String) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<Cow<'a, str>> for bstr
[src]
fn eq(&self, rhs: &Cow<'a, str>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &Cow<'a, str>) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<bstr> for &'a bstr
[src]
fn eq(&self, rhs: &bstr) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &bstr) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<BString> for &'a bstr
[src]
fn eq(&self, rhs: &BString) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &BString) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<Cow<'b, bstr>> for &'a bstr
[src]
fn eq(&self, rhs: &Cow<'b, bstr>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &Cow<'b, bstr>) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<str> for &'a bstr
[src]
fn eq(&self, rhs: &str) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &str) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<String> for &'a bstr
[src]
fn eq(&self, rhs: &String) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &String) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<Cow<'b, str>> for &'a bstr
[src]
fn eq(&self, rhs: &Cow<'b, str>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &Cow<'b, str>) -> bool
This method tests for !=
.
impl PartialEq<Vec<u8>> for bstr
[src]
fn eq(&self, rhs: &Vec<u8>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &Vec<u8>) -> bool
This method tests for !=
.
impl PartialEq<[u8]> for bstr
[src]
fn eq(&self, rhs: &[u8]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 0]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 0]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 0]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 0]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 0]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 0]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 1]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 1]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 1]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 1]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 1]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 1]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 2]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 2]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 2]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 2]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 2]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 2]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 3]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 3]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 3]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 3]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 3]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 3]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 4]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 4]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 4]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 4]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 4]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 4]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 5]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 5]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 5]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 5]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 5]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 5]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 6]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 6]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 6]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 6]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 6]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 6]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 7]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 7]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 7]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 7]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 7]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 7]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 8]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 8]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 8]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 8]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 8]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 8]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 9]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 9]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 9]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 9]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 9]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 9]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 10]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 10]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 10]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 10]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 10]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 10]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 11]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 11]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 11]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 11]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 11]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 11]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 12]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 12]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 12]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 12]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 12]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 12]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 13]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 13]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 13]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 13]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 13]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 13]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 14]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 14]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 14]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 14]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 14]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 14]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 15]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 15]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 15]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 15]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 15]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 15]) -> bool
This method tests for !=
.
impl<'a> PartialEq<[u8; 16]> for &'a bstr
[src]
fn eq(&self, rhs: &[u8; 16]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &[u8; 16]) -> bool
This method tests for !=
.
impl<'a, 'b> PartialEq<&'b [u8; 16]> for &'a bstr
[src]
fn eq(&self, rhs: &&[u8; 16]) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, rhs: &&[u8; 16]) -> bool
This method tests for !=
.
impl Ord for bstr
[src]
fn cmp(&self, rhs: &bstr) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl PartialOrd for bstr
[src]
fn partial_cmp(&self, rhs: &bstr) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, rhs: &bstr) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn gt(&self, rhs: &bstr) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn le(&self, rhs: &bstr) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn ge(&self, rhs: &bstr) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, 'b> Pattern<'a> for &'b bstr
[src]
Non-allocating substring search.
Will handle the pattern ""
as returning empty matches at each character
boundary.
type Searcher = StrSearcher<'a, 'b>
Associated searcher for this pattern
fn into_searcher(self, haystack: &'a bstr) -> StrSearcher<'a, 'b>
Constructs the associated searcher from self
and the haystack
to search in. Read more
fn is_prefix_of(self, haystack: &'a bstr) -> bool
Checks whether the pattern matches at the front of the haystack
fn is_suffix_of(self, haystack: &'a bstr) -> bool
Checks whether the pattern matches at the back of the haystack
fn is_contained_in(self, haystack: &'a bstr) -> bool
Checks whether the pattern matches anywhere in the haystack