Struct bytes::SeqByteStr [] [src]

pub struct SeqByteStr {
    // some fields omitted
}

Methods

impl SeqByteStr
[src]

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

Create a new SeqByteStr from a byte slice.

The contents of the byte slice will be copied.

unsafe fn from_mem_ref(mem: MemRef, pos: u32, len: u32) -> SeqByteStr

Creates a new SeqByteStr from a MemRef, an offset, and a length.

This function is unsafe as there are no guarantees that the given arguments are valid.

Trait Implementations

impl ByteStr for SeqByteStr
[src]

type Buf = ROByteBuf

fn buf(&self) -> ROByteBuf

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 SeqByteStr
[src]

fn to_bytes(self) -> Bytes

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

impl Index<usize> for SeqByteStr
[src]

type Output = u8

The returned type after indexing

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

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

impl Clone for SeqByteStr
[src]

fn clone(&self) -> SeqByteStr

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<B: ByteStr> PartialEq<B> for SeqByteStr
[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 !=.