Trait capnp::message::ReaderSegments[][src]

pub trait ReaderSegments {
    fn get_segment<'a>(&'a self, idx: u32) -> Option<&'a [u8]>;

    fn len(&self) -> usize { ... }
}

An object that manages the buffers underlying a Cap’n Proto message reader.

Required methods

fn get_segment<'a>(&'a self, idx: u32) -> Option<&'a [u8]>[src]

Gets the segment with index idx. Returns None if idx is out of range.

The segment must be 8-byte aligned or the “unaligned” feature must be enabled in the capnp crate. (Otherwise reading the segment will return an error.)

The returned slice is required to point to memory that remains valid until the ReaderSegments object is dropped. In safe Rust, it should not be possible to violate this requirement.

Loading content...

Provided methods

fn len(&self) -> usize[src]

Gets the number of segments.

Loading content...

Implementations on Foreign Types

impl<S> ReaderSegments for &S where
    S: ReaderSegments
[src]

impl<'b> ReaderSegments for [&'b [u8]][src]

Loading content...

Implementors

impl ReaderSegments for OwnedSegments[src]

impl<'a> ReaderSegments for SliceSegments<'a>[src]

impl<'b> ReaderSegments for SegmentArray<'b>[src]

impl<'s> ReaderSegments for OutputSegments<'s>[src]

impl<A> ReaderSegments for Builder<A> where
    A: Allocator
[src]

Loading content...