pub trait ToLocated<Loc: Display>: Sized {
    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

Create a Located from its inner value.

Implementors