pub struct SourceSpan { /* private fields */ }Expand description
One exact source range using one-based lines and zero-based columns.
Implementations§
Source§impl SourceSpan
impl SourceSpan
Sourcepub fn new(
start_line: u32,
start_column: u32,
end_line: u32,
end_column: u32,
) -> Result<Self, GraphContractError>
pub fn new( start_line: u32, start_column: u32, end_line: u32, end_column: u32, ) -> Result<Self, GraphContractError>
Validate a non-reversed source range.
§Errors
Returns an error for zero lines or an end before the start.
Sourcepub const fn start_line(self) -> u32
pub const fn start_line(self) -> u32
Return the first one-based line.
Sourcepub const fn start_column(self) -> u32
pub const fn start_column(self) -> u32
Return the first zero-based column.
Sourcepub const fn end_column(self) -> u32
pub const fn end_column(self) -> u32
Return the exclusive zero-based end column.
Trait Implementations§
Source§impl Clone for SourceSpan
impl Clone for SourceSpan
Source§fn clone(&self) -> SourceSpan
fn clone(&self) -> SourceSpan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceSpan
impl Debug for SourceSpan
Source§impl<'de> Deserialize<'de> for SourceSpan
impl<'de> Deserialize<'de> for SourceSpan
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 PartialEq for SourceSpan
impl PartialEq for SourceSpan
Source§impl Serialize for SourceSpan
impl Serialize for SourceSpan
impl Copy for SourceSpan
impl Eq for SourceSpan
impl StructuralPartialEq for SourceSpan
Auto Trait Implementations§
impl Freeze for SourceSpan
impl RefUnwindSafe for SourceSpan
impl Send for SourceSpan
impl Sync for SourceSpan
impl Unpin for SourceSpan
impl UnwindSafe for SourceSpan
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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.