Struct proc_macro::SourceFile [−][src]
pub struct SourceFile(_);
Expand description
The source file of a given Span.
Implementations
impl SourceFile[src]
impl SourceFile[src]pub fn path(&self) -> PathBuf[src]
pub fn path(&self) -> PathBuf[src]Gets the path to this source file.
Note
If the code span associated with this SourceFile was generated by an external macro, this
macro, this may not be an actual path on the filesystem. Use is_real to check.
Also note that even if is_real returns true, if --remap-path-prefix was passed on
the command line, the path as given may not actually be valid.
Trait Implementations
impl Clone for SourceFile[src]
impl Clone for SourceFile[src]fn clone(&self) -> SourceFile[src]
fn clone(&self) -> SourceFile[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl Debug for SourceFile[src]
impl Debug for SourceFile[src]impl PartialEq<SourceFile> for SourceFile[src]
impl PartialEq<SourceFile> for SourceFile[src]impl Eq for SourceFile[src]
Auto Trait Implementations
impl RefUnwindSafe for SourceFile
impl !Send for SourceFile
impl !Sync for SourceFile
impl Unpin for SourceFile
impl UnwindSafe for SourceFile
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into #41263)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more