Enum rustc_span::RealFileName
source · [−]pub enum RealFileName {
LocalPath(PathBuf),
Remapped {
local_path: Option<PathBuf>,
virtual_name: PathBuf,
},
}
Variants
LocalPath(PathBuf)
Remapped
Fields
local_path: Option<PathBuf>
local_path
is the (host-dependent) local path to the file. This is
None if the file was imported from another crate
virtual_name: PathBuf
virtual_name
is the stable path rustc will store internally within
build artifacts.
For remapped paths (namely paths into libstd that have been mapped
to the appropriate spot on the local host’s file system, and local file
system paths that have been remapped with FilePathMapping
),
Implementations
sourceimpl RealFileName
impl RealFileName
sourcepub fn local_path(&self) -> Option<&Path>
pub fn local_path(&self) -> Option<&Path>
Returns the path suitable for reading from the file system on the local host,
if this information exists.
Avoid embedding this in build artifacts; see remapped_path_if_available()
for that.
sourcepub fn into_local_path(self) -> Option<PathBuf>
pub fn into_local_path(self) -> Option<PathBuf>
Returns the path suitable for reading from the file system on the local host,
if this information exists.
Avoid embedding this in build artifacts; see remapped_path_if_available()
for that.
sourcepub fn remapped_path_if_available(&self) -> &Path
pub fn remapped_path_if_available(&self) -> &Path
Returns the path suitable for embedding into build artifacts. This would still
be a local path if it has not been remapped. A remapped path will not correspond
to a valid file system path: see local_path_if_available()
for something that
is more likely to return paths into the local host file system.
sourcepub fn local_path_if_available(&self) -> &Path
pub fn local_path_if_available(&self) -> &Path
Returns the path suitable for reading from the file system on the local host,
if this information exists. Otherwise returns the remapped name.
Avoid embedding this in build artifacts; see remapped_path_if_available()
for that.
pub fn to_string_lossy(
&self,
display_pref: FileNameDisplayPreference
) -> Cow<'_, str>
Trait Implementations
sourceimpl Clone for RealFileName
impl Clone for RealFileName
sourcefn clone(&self) -> RealFileName
fn clone(&self) -> RealFileName
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RealFileName
impl Debug for RealFileName
sourceimpl<__D: Decoder> Decodable<__D> for RealFileName
impl<__D: Decoder> Decodable<__D> for RealFileName
sourceimpl<S: Encoder> Encodable<S> for RealFileName
impl<S: Encoder> Encodable<S> for RealFileName
sourceimpl Hash for RealFileName
impl Hash for RealFileName
sourceimpl Ord for RealFileName
impl Ord for RealFileName
sourceimpl PartialEq<RealFileName> for RealFileName
impl PartialEq<RealFileName> for RealFileName
sourcefn eq(&self, other: &RealFileName) -> bool
fn eq(&self, other: &RealFileName) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RealFileName) -> bool
fn ne(&self, other: &RealFileName) -> bool
This method tests for !=
.
sourceimpl PartialOrd<RealFileName> for RealFileName
impl PartialOrd<RealFileName> for RealFileName
sourcefn partial_cmp(&self, other: &RealFileName) -> Option<Ordering>
fn partial_cmp(&self, other: &RealFileName) -> 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 RealFileName
impl StructuralEq for RealFileName
impl StructuralPartialEq for RealFileName
Auto Trait Implementations
impl RefUnwindSafe for RealFileName
impl Send for RealFileName
impl Sync for RealFileName
impl Unpin for RealFileName
impl UnwindSafe for RealFileName
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)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes
Size for each variant:
LocalPath
: 24 bytesRemapped
: 48 bytes