language_reporting

Trait ReportingFiles

Source
pub trait ReportingFiles: Debug + Clone {
    type Span: ReportingSpan;
    type FileId: Copy;

    // Required methods
    fn byte_span(
        &self,
        file: Self::FileId,
        from_index: usize,
        to_index: usize,
    ) -> Option<Self::Span>;
    fn file_id(&self, span: Self::Span) -> Self::FileId;
    fn file_name(&self, file: Self::FileId) -> FileName;
    fn byte_index(
        &self,
        file: Self::FileId,
        line: usize,
        column: usize,
    ) -> Option<usize>;
    fn location(
        &self,
        file: Self::FileId,
        byte_index: usize,
    ) -> Option<Location>;
    fn line_span(&self, file: Self::FileId, lineno: usize) -> Option<Self::Span>;
    fn source(&self, span: Self::Span) -> Option<String>;
}

Required Associated Types§

Required Methods§

Source

fn byte_span( &self, file: Self::FileId, from_index: usize, to_index: usize, ) -> Option<Self::Span>

Source

fn file_id(&self, span: Self::Span) -> Self::FileId

Source

fn file_name(&self, file: Self::FileId) -> FileName

Source

fn byte_index( &self, file: Self::FileId, line: usize, column: usize, ) -> Option<usize>

Source

fn location(&self, file: Self::FileId, byte_index: usize) -> Option<Location>

Source

fn line_span(&self, file: Self::FileId, lineno: usize) -> Option<Self::Span>

Source

fn source(&self, span: Self::Span) -> Option<String>

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§