pub struct Span {
pub start: u32,
pub end: u32,
}Expand description
Describes the location of a substring within a string.
Fields§
§start: u32The start of the substring.
end: u32The end of the substring.
Implementations§
Source§impl Span
impl Span
Sourcepub fn with_src<T>(self, src: T) -> SpanWithSource<T>
pub fn with_src<T>(self, src: T) -> SpanWithSource<T>
Link the underlying span with its source.
Sourcepub fn extend_end(self, end: u32) -> Span
pub fn extend_end(self, end: u32) -> Span
Expand the current span to end. If end is less than the current end, then self is
returned
Sourcepub fn next_window(self, len: u32) -> Span
pub fn next_window(self, len: u32) -> Span
Get the next window. The next window is defined as starting at the end of self with length
end.
Trait Implementations§
impl Copy 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