Trait FromLineOffset

Source
pub trait FromLineOffset: Sized {
    type Offset: TryFrom<u64> + Into<u64>;

    // Required methods
    fn offset(&self) -> Self::Offset;
    fn from_line_offset(line: &str, offset: Self::Offset) -> Result<Self>;
}
Expand description

A trait for items that can be created from a line and an offset.

Required Associated Types§

Source

type Offset: TryFrom<u64> + Into<u64>

The type of the offset.

Required Methods§

Source

fn offset(&self) -> Self::Offset

Returns the item’s offset.

Source

fn from_line_offset(line: &str, offset: Self::Offset) -> Result<Self>

Creates an item from a line and an offset.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§