Struct sway_types::span::Span
source · [−]pub struct Span { /* private fields */ }
Expand description
Represents a span of the source code in a specific file.
Implementations
sourceimpl Span
impl Span
pub fn dummy() -> Span
pub fn new(
src: Arc<str>,
start: usize,
end: usize,
path: Option<Arc<PathBuf>>
) -> Option<Span>
pub fn from_string(source: String) -> Span
pub fn src(&self) -> &Arc<str>
pub fn start(&self) -> usize
pub fn end(&self) -> usize
pub fn path(&self) -> Option<&Arc<PathBuf>>
pub fn path_str(&self) -> Option<Cow<'_, str>>
pub fn start_pos(&self) -> Position
pub fn end_pos(&self) -> Position
pub fn split(&self) -> (Position, Position)
pub fn str(self) -> String
pub fn as_str(&self) -> &str
pub fn input(&self) -> &str
pub fn trim(self) -> Span
Trait Implementations
sourceimpl PartialEq<Span> for Span
impl PartialEq<Span> for Span
sourceimpl PartialOrd<Span> for Span
impl PartialOrd<Span> for Span
sourcefn partial_cmp(&self, other: &Span) -> Option<Ordering>
fn partial_cmp(&self, other: &Span) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Eq for Span
impl StructuralEq for Span
impl StructuralPartialEq for Span
Auto Trait Implementations
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnwindSafe for Span
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more