BitStr

Struct BitStr 

Source
pub struct BitStr { /* private fields */ }

Implementations§

Source§

impl BitStr

Source

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

Examples found in repository?
examples/contains_u8.rs (line 4)
3fn main() {
4    let str_bitstr: &BitStr = BitStr::from(b"Rio");
5    str_bitstr.contains_u8(4);
6}
Source

pub fn from_str(bytes: &str) -> &Self

Source

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

Source

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

Source

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

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn contains_u8(&self, x: u8) -> bool

Examples found in repository?
examples/contains_u8.rs (line 5)
3fn main() {
4    let str_bitstr: &BitStr = BitStr::from(b"Rio");
5    str_bitstr.contains_u8(4);
6}
Source

pub fn contains(&self, x: u8) -> bool

Source

pub fn starts_with<T: AsRef<BitStr>>(&self, x: T) -> bool

Source

pub fn ends_with<T: AsRef<BitStr>>(&self, x: T) -> bool

Source

pub fn bytes(&self) -> Cloned<Iter<'_, u8>>

Source

pub fn bytes_mut(&mut self) -> IterMut<'_, u8>

Source

pub fn to_str(&self) -> Result<&str, Utf8Error>

Source

pub fn is_ascii(&self) -> bool

Source

pub fn eq_ignore_ascii_case(&self, other: &BitStr) -> bool

Source

pub fn make_ascii_uppercase(&mut self)

Source

pub fn make_ascii_lowercase(&mut self)

Trait Implementations§

Source§

impl AsRef<[u8]> for BitStr

Source§

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

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

impl AsRef<BitStr> for [u8]

Source§

fn as_ref(&self) -> &BitStr

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

impl AsRef<BitStr> for BitStr

Source§

fn as_ref(&self) -> &BitStr

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

impl AsRef<BitStr> for str

Source§

fn as_ref(&self) -> &BitStr

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

impl Debug for BitStr

Source§

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

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

impl<'a> Default for &'a BitStr

Source§

fn default() -> Self

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

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

Source§

fn default() -> Self

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

impl Display for BitStr

Source§

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

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

impl<'a> From<&'a [u8]> for &'a BitStr

Source§

fn from(src: &'a [u8]) -> &'a BitStr

Converts to this type from the input type.
Source§

impl Hash for BitStr

Source§

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

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

impl<'a> IntoIterator for &'a BitStr

Source§

type Item = u8

The type of the elements being iterated over.
Source§

type IntoIter = Cloned<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 BitStr

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 Ord for BitStr

Source§

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

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

impl PartialEq<&[u8]> for BitStr

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<&str> for BitStr

Source§

fn eq(&self, other: &&str) -> 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 BitStr

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<BitStr> for &[u8]

Source§

fn eq(&self, other: &BitStr) -> 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<BitStr> for &str

Source§

fn eq(&self, other: &BitStr) -> 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<BitStr> for [u8]

Source§

fn eq(&self, other: &BitStr) -> 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<BitStr> for str

Source§

fn eq(&self, other: &BitStr) -> 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<str> for BitStr

Source§

fn eq(&self, other: &str) -> 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 BitStr

Source§

fn eq(&self, other: &BitStr) -> 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 PartialOrd<&[u8]> for BitStr

Source§

fn partial_cmp(&self, other: &&[u8]) -> Option<Ordering>

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

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

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

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

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

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

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

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

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

impl PartialOrd<&str> for BitStr

Source§

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

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

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

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

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

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

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

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

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

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

impl PartialOrd<[u8]> for BitStr

Source§

fn partial_cmp(&self, other: &[u8]) -> Option<Ordering>

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

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

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

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

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

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

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

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

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

impl PartialOrd<BitStr> for &[u8]

Source§

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

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

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

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

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

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

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

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

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

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

impl PartialOrd<BitStr> for &str

Source§

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

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

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

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

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

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

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

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

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

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

impl PartialOrd<BitStr> for [u8]

Source§

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

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

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

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

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

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

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

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

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

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

impl PartialOrd<BitStr> for str

Source§

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

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

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

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

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

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

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

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

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

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

impl PartialOrd<str> for BitStr

Source§

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

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

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

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

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

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

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

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

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

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

impl PartialOrd for BitStr

Source§

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

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

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

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

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

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

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

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

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

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

impl Eq for BitStr

Source§

impl StructuralPartialEq for BitStr

Auto Trait Implementations§

§

impl Freeze for BitStr

§

impl RefUnwindSafe for BitStr

§

impl Send for BitStr

§

impl !Sized for BitStr

§

impl Sync for BitStr

§

impl Unpin for BitStr

§

impl UnwindSafe for BitStr

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more