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
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for RealFileName
impl Debug for RealFileName
sourceimpl<__D: Decoder> Decodable<__D> for RealFileName
impl<__D: Decoder> Decodable<__D> for RealFileName
sourceimpl Hash for RealFileName
impl Hash for RealFileName
sourceimpl Ord for RealFileName
impl Ord for RealFileName
sourcefn cmp(&self, other: &RealFileName) -> Ordering
fn cmp(&self, other: &RealFileName) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialEq<RealFileName> for RealFileName
impl PartialEq<RealFileName> for RealFileName
sourcefn eq(&self, other: &RealFileName) -> bool
fn eq(&self, other: &RealFileName) -> bool
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>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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: 48 bytes
Size for each variant:
LocalPath
: 24 bytesRemapped
: 48 bytes