pub struct Span {
pub begin: Position,
pub end: Position,
}Expand description
A Span represents an arbitrary source range. It includes the beginning and ending Positions.
Fields§
§begin: Position§end: PositionImplementations§
Source§impl Span
impl Span
Sourcepub fn new(
begin_line: usize,
begin_column: usize,
end_line: usize,
end_column: usize,
) -> Self
pub fn new( begin_line: usize, begin_column: usize, end_line: usize, end_column: usize, ) -> Self
Create a new Span. The beginning and ending Positions will also be created.
§Arguments
begin_lineThe line number for the beginning of the Span, where the first line of the file is at zero.begin_columnThe column number for the beginning of the Span, where the first column of a line is at zero.end_lineThe line number for the ending of the Span, where the first line of the file is at zero.end_columnThe column number for the ending of the Span, where the first column of a line is at zero.
§Return
A new Span, with new beginning and ending Positions.
Sourcepub fn from_begin_end<Pos>(begin: Pos, end: Pos) -> Self
pub fn from_begin_end<Pos>(begin: Pos, end: Pos) -> Self
pub fn merge(self, other: Span) -> Span
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 Ord for Span
impl Ord for Span
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
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 UnsafeUnpin 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