Struct proc_macro::SourceFile
source · [−]pub struct SourceFile(_);Expand description
The source file of a given Span.
Implementations
impl SourceFile
source
impl SourceFile
sourcepub fn path(&self) -> PathBuf
source
pub fn path(&self) -> PathBuf
sourceGets the path to this source file.
Note
If the code span associated with this SourceFile was generated by an external macro, this
macro, this might 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 might not actually be valid.
Trait Implementations
impl Clone for SourceFile
source
impl Clone for SourceFile
sourcefn clone(&self) -> SourceFile
source
fn clone(&self) -> SourceFile
sourceReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0 · source
fn clone_from(&mut self, source: &Self)
1.0.0 · sourcePerforms copy-assignment from source. Read more
impl Debug for SourceFile
source
impl Debug for SourceFile
sourceimpl PartialEq<SourceFile> for SourceFile
source
impl PartialEq<SourceFile> for SourceFile
sourceimpl Eq for SourceFile
sourceAuto 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,
source
impl<T> BorrowMut<T> for T where
T: ?Sized,
sourcefn borrow_mut(&mut self) -> &mut T
const: unstable · source
fn borrow_mut(&mut self) -> &mut T
const: unstable · sourceMutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
source
impl<T> ToOwned for T where
T: Clone,
sourcetype Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
source
fn clone_into(&self, target: &mut T)
sourceUses borrowed data to replace owned data, usually by cloning. Read more