Struct regex_syntax::ast::Span
source · pub struct Span {
pub start: Position,
pub end: Position,
}
Expand description
Span represents the position information of a single AST item.
All span positions are absolute byte offsets that can be used on the original regular expression that was parsed.
Fields§
§start: Position
The start byte offset.
end: Position
The end byte offset.
Implementations§
source§impl Span
impl Span
sourcepub fn splat(pos: Position) -> Span
pub fn splat(pos: Position) -> Span
Create a new span using the given position as the start and end.
sourcepub fn with_start(self, pos: Position) -> Span
pub fn with_start(self, pos: Position) -> Span
Create a new span by replacing the starting the position with the one given.
sourcepub fn with_end(self, pos: Position) -> Span
pub fn with_end(self, pos: Position) -> Span
Create a new span by replacing the ending the position with the one given.
sourcepub fn is_one_line(&self) -> bool
pub fn is_one_line(&self) -> bool
Returns true if and only if this span occurs on a single line.
Trait Implementations§
source§impl Ord for Span
impl Ord for Span
source§impl PartialEq for Span
impl PartialEq for Span
source§impl PartialOrd for Span
impl PartialOrd for Span
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)