Struct sway_types::span::Span
source · [−]Expand description
Represents a span of the source code in a specific file.
Fields
span: Span
A pest::Span returned directly from the generated parser.
path: Option<Arc<PathBuf>>
Implementations
sourceimpl Span
impl Span
pub fn start(&self) -> usize
pub fn end(&self) -> usize
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 path(&self) -> String
pub fn trim(self) -> Span
Trait Implementations
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more