pub struct Span { /* private fields */ }Expand description
A location in &'a str
Implementations§
Source§impl Span
impl Span
pub const fn no_span() -> Span
pub fn new(range: Range<usize>) -> Self
pub fn byte_range(self) -> Option<Range<usize>>
Sourcepub fn as_infix_of<'a>(&self, source: &'a str) -> Option<&'a str>
pub fn as_infix_of<'a>(&self, source: &'a str) -> Option<&'a str>
The substring in source contained in self.byte_range().
Sourcepub fn as_suffix_of<'a>(&self, source: &'a str) -> Option<&'a str>
pub fn as_suffix_of<'a>(&self, source: &'a str) -> Option<&'a str>
The substring in source starting from self.start.
pub fn is_overlapping(&self, other: Span) -> bool
Trait Implementations§
impl Copy 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