Enum rustc_span::RealFileName
source · pub enum RealFileName {
LocalPath(PathBuf),
Remapped {
local_path: Option<PathBuf>,
virtual_name: PathBuf,
},
}
Variants§
LocalPath(PathBuf)
Remapped
Fields
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§
source§impl 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§
source§impl Clone for RealFileName
impl Clone for RealFileName
source§fn clone(&self) -> RealFileName
fn clone(&self) -> RealFileName
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RealFileName
impl Debug for RealFileName
source§impl<__D: Decoder> Decodable<__D> for RealFileName
impl<__D: Decoder> Decodable<__D> for RealFileName
source§impl Hash for RealFileName
impl Hash for RealFileName
source§impl Ord for RealFileName
impl Ord for RealFileName
source§fn cmp(&self, other: &RealFileName) -> Ordering
fn cmp(&self, other: &RealFileName) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<RealFileName> for RealFileName
impl PartialEq<RealFileName> for RealFileName
source§fn eq(&self, other: &RealFileName) -> bool
fn eq(&self, other: &RealFileName) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<RealFileName> for RealFileName
impl PartialOrd<RealFileName> for RealFileName
source§fn partial_cmp(&self, other: &RealFileName) -> Option<Ordering>
fn partial_cmp(&self, other: &RealFileName) -> Option<Ordering>
1.0.0 · source§fn 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn 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
: 32 bytesRemapped
: 48 bytes