Enum rustc_span::RealFileName
source · pub enum RealFileName {
LocalPath(PathBuf),
Remapped {
local_path: Option<PathBuf>,
virtual_name: PathBuf,
},
}
Variants§
LocalPath(PathBuf)
Remapped
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.
sourcepub fn to_path(&self, display_pref: FileNameDisplayPreference) -> &Path
pub fn to_path(&self, display_pref: FileNameDisplayPreference) -> &Path
Return the path remmapped or not depending on the FileNameDisplayPreference
.
For the purpose of this function, local and short preference are equal.
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: SpanDecoder> Decodable<__D> for RealFileName
impl<__D: SpanDecoder> 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 for RealFileName
impl PartialEq for RealFileName
source§impl PartialOrd for RealFileName
impl PartialOrd for RealFileName
impl Eq for RealFileName
impl StructuralPartialEq for RealFileName
Auto Trait Implementations§
impl Freeze for RealFileName
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
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