Struct bytes::SmallByteStr [] [src]

pub struct SmallByteStr {
    // some fields omitted
}

Methods

impl SmallByteStr
[src]

fn zero() -> SmallByteStr

fn from_slice(bytes: &[u8]) -> Option<SmallByteStr>

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

Trait Implementations

impl Copy for SmallByteStr
[src]

impl Clone for SmallByteStr
[src]

fn clone(&self) -> SmallByteStr

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl ByteStr for SmallByteStr
[src]

type Buf = SmallByteStrBuf

fn buf(&self) -> SmallByteStrBuf

Returns a read-only Buf for accessing the byte contents of the ByteStr. Read more

fn concat<B: ByteStr + 'static>(&self, other: &B) -> Bytes

Returns a new Bytes value representing the concatenation of self with the given Bytes. Read more

fn len(&self) -> usize

Returns the number of bytes in the ByteStr

fn slice(&self, begin: usize, end: usize) -> Bytes

Returns a new ByteStr value containing the byte range between begin (inclusive) and end (exclusive) Read more

fn is_empty(&self) -> bool

Returns true if the length of the ByteStr is 0

fn slice_from(&self, begin: usize) -> Bytes

Returns a new ByteStr value containing the byte range starting from begin (inclusive) to the end of the byte str. Read more

fn slice_to(&self, end: usize) -> Bytes

Returns a new ByteStr value containing the byte range from the start up to end (exclusive). Read more

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

Divides the value into two Bytes at the given index. Read more

impl ToBytes for SmallByteStr
[src]

fn to_bytes(self) -> Bytes

Consumes the value and returns a Bytes instance containing identical bytes Read more

impl Index<usize> for SmallByteStr
[src]

type Output = u8

The returned type after indexing

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

The method for the indexing (Foo[Bar]) operation

impl<B: ByteStr> PartialEq<B> for SmallByteStr
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

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

This method tests for !=.