Trait pdf::backend::IndexRange

source ·
pub trait IndexRange {
    // Required methods
    fn start(&self) -> Option<usize>;
    fn end(&self) -> Option<usize>;

    // Provided method
    fn to_range(&self, len: usize) -> Result<Range<usize>> { ... }
}
Expand description

IndexRange is implemented by Rust’s built-in range types, produced by range syntax like .., a.., ..b or c..d.

Required Methods§

source

fn start(&self) -> Option<usize>

Start index (inclusive)

source

fn end(&self) -> Option<usize>

End index (exclusive)

Provided Methods§

source

fn to_range(&self, len: usize) -> Result<Range<usize>>

len: the size of whatever container that is being indexed

Implementations on Foreign Types§

source§

impl IndexRange for Range<usize>

source§

fn start(&self) -> Option<usize>

source§

fn end(&self) -> Option<usize>

source§

impl IndexRange for RangeFrom<usize>

source§

fn start(&self) -> Option<usize>

source§

fn end(&self) -> Option<usize>

source§

impl IndexRange for RangeFull

source§

fn start(&self) -> Option<usize>

source§

fn end(&self) -> Option<usize>

source§

impl IndexRange for RangeTo<usize>

source§

fn start(&self) -> Option<usize>

source§

fn end(&self) -> Option<usize>

Implementors§