Located

Trait Located 

Source
pub trait Located {
    // Required method
    fn location(&self) -> Location;

    // Provided methods
    fn span(&self) -> Span { ... }
    fn file_id(&self) -> FileId { ... }
    fn primary(&self, message: impl Into<String>) -> Label { ... }
    fn secondary(&self, message: impl Into<String>) -> Label { ... }
}
Expand description

Implements utilities for types who have a Location attached to them.

Required Methods§

Source

fn location(&self) -> Location

Returns the Location this item is from.

Provided Methods§

Source

fn span(&self) -> Span

Returns the span this item originates from.

Source

fn file_id(&self) -> FileId

Returns the file id this item originates from.

Source

fn primary(&self, message: impl Into<String>) -> Label

Creates a primary label for diagnostics with this item’s information

Source

fn secondary(&self, message: impl Into<String>) -> Label

Creates a secondary label for diagnostics with this item’s information

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§