Trait partiql_source_map::location::ToLocated

source ·
pub trait ToLocated<Loc: Display>: Sized {
    // Provided method
    fn to_located<IntoLoc>(self, location: IntoLoc) -> Located<Self, Loc>
       where IntoLoc: Into<Location<Loc>> { ... }
}
Expand description

Trait adding a to_located method to ease construction of Located from its inner value.

§Example

assert_eq!("blah".to_string().to_located(BytePosition::from(5)..BytePosition::from(10)),
            Located{
                inner: "blah".to_string(),
                location:  (BytePosition(ByteOffset(5))..BytePosition(ByteOffset(10))).into()
            });

Provided Methods§

source

fn to_located<IntoLoc>(self, location: IntoLoc) -> Located<Self, Loc>
where IntoLoc: Into<Location<Loc>>,

Create a Located from its inner value.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, Loc: Display> ToLocated<Loc> for T