pub struct SynPos {
pub syn: Syntax,
pub info: Rc<SynPosInfo>,
}
Expand description
Structure for holding information about origin of an AST node.
Fields
syn: Syntax
info: Rc<SynPosInfo>
Implementations
sourceimpl SynPos
impl SynPos
pub fn empty() -> Self
pub fn new(syn: Syntax, line: u32, col: u32, file: FileRef) -> Self
pub fn has_info(&self) -> bool
pub fn line(&self) -> u32
pub fn col(&self) -> u32
pub fn filename(&self) -> &str
pub fn syn(&self) -> Syntax
pub fn set_syn(&mut self, syn: Syntax)
pub fn set_name(&mut self, name: &str)
pub fn s_short(&self) -> String
pub fn s_only_pos(&self) -> String
Trait Implementations
impl StructuralPartialEq for SynPos
Auto Trait Implementations
impl RefUnwindSafe for SynPos
impl !Send for SynPos
impl !Sync for SynPos
impl Unpin for SynPos
impl UnwindSafe for SynPos
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