[][src]Trait abin::Segment

pub trait Segment {
    fn number_of_bytes(&self) -> usize;
fn empty() -> Self; fn is_empty(&self) -> bool { ... } }

Some sort of segment that knows its length (in bytes). It's used for constructing binaries/strings efficiently (knowing the entire length in advance to avoid re-allocations).

Required methods

fn number_of_bytes(&self) -> usize

The number of bytes in this segment.

fn empty() -> Self

Constructs an empty-segment (number_of_bytes is 0).

Loading content...

Provided methods

fn is_empty(&self) -> bool

Same as number_of_bytes==0.

Loading content...

Implementors

impl<'a, TAnyBin> Segment for BinSegment<'a, TAnyBin> where
    TAnyBin: AnyBin
[src]

impl<'a, TBin: AnyBin> Segment for StrSegment<'a, TBin>[src]

Loading content...