pub struct Span {
pub start: usize,
pub end: usize,
}
Expand description
A byte-index tuple representing a span of characters in a string
Fields§
§start: usize
§end: usize
Implementations§
Source§impl Span
impl Span
pub fn new(start: usize, end: usize) -> Span
Sourcepub fn relative_span(&self, dockerfile: &Dockerfile) -> (usize, Span)
pub fn relative_span(&self, dockerfile: &Dockerfile) -> (usize, Span)
Determines the 0-indexed line number and line-relative position of this span.
A reference to the Dockerfile is necessary to examine the original input
string. Note that if the original span crosses a newline boundary, the
relative span’s end
field will be larger than the line length.
Trait Implementations§
Source§impl Ord for Span
impl Ord for Span
Source§impl PartialOrd for Span
impl PartialOrd for Span
impl Copy for Span
impl Eq for Span
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnwindSafe for Span
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more