#[repr(C)]pub struct Span {
pub start: Position,
pub end: Position,
}Fields§
§start: Position§end: PositionImplementations§
Source§impl Span
impl Span
pub fn new(start: Position, end: Position) -> Self
pub fn between(start: Span, end: Span) -> Self
pub fn join(self, other: Span) -> Span
pub fn contains(&self, position: &impl HasPosition) -> bool
pub fn has_offset(&self, offset: usize) -> bool
pub fn to_range(&self) -> Range<usize>
pub fn length(&self) -> usize
pub fn subspan(&self, start: usize, end: usize) -> Span
pub fn is_before(&self, other: impl HasPosition) -> bool
pub fn is_after(&self, other: impl HasPosition) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Span
impl<'de> Deserialize<'de> for Span
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Span> for SourceIdentifier
impl From<&Span> for SourceIdentifier
Source§fn from(span: &Span) -> SourceIdentifier
fn from(span: &Span) -> SourceIdentifier
Converts to this type from the input type.
Source§impl From<Span> for SourceIdentifier
impl From<Span> for SourceIdentifier
Source§fn from(span: Span) -> SourceIdentifier
fn from(span: Span) -> SourceIdentifier
Converts to this type from the input type.
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