OffsetSize

Trait OffsetSize 

Source
pub trait OffsetSize {
    // Required methods
    fn offset(&self) -> Offset;
    fn size(&self) -> Size;

    // Provided methods
    fn start(&self) -> Offset { ... }
    fn end(&self) -> Offset { ... }
}
Expand description

A trait for types that span a range with an offset and size

This trait is implemented by types that represent a contiguous range of data with a starting offset and a size. It provides methods to access the start, end, and size of the span.

Required Methods§

Source

fn offset(&self) -> Offset

Returns the starting offset of the span

Source

fn size(&self) -> Size

Returns the size of the span

Provided Methods§

Source

fn start(&self) -> Offset

Returns the starting offset of the span. This is an alias for offset().

Source

fn end(&self) -> Offset

Returns the end offset of the span (offset + size)

Implementations on Foreign Types§

Source§

impl<T> Span for &T
where T: Span,

Source§

fn offset(&self) -> Offset

Source§

fn size(&self) -> Size

Implementors§

Source§

impl<C> Span for Segment<C>
where C: CodeqConfig,