Struct miette::SourceOffset [−][src]
pub struct SourceOffset(_);
Expand description
Newtype that represents the ByteOffset from the beginning of a Source
Implementations
Actual byte offset.
Little utility to help convert line/column locations into miette-compatible Spans
This function is infallible: Giving an out-of-range line/column pair will return the offset of the last byte in the source.
Returns an offset for the file location of wherever this function is called. If you want to get that caller’s location, mark this function’s caller with #[track_caller] (and so on and so forth).
Returns both the filename that was given and the offset of the caller as a SourceOffset
Keep in mind that this fill only work if the file your Rust source file was compiled from is actually available at that location. If you’re shipping binaries for your application, you’ll want to ignore the Err case or otherwise report it.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for SourceOffset
impl Send for SourceOffset
impl Sync for SourceOffset
impl Unpin for SourceOffset
impl UnwindSafe for SourceOffset
Blanket Implementations
Mutably borrows from an owned value. Read more