pub struct FileInfo<'data> { /* private fields */ }Expand description
File information referred by LineInfo comprising a directory and name.
The file path is usually relative to a compilation directory. It might contain parent directory
segments (../).
Implementations§
Source§impl<'data> FileInfo<'data>
impl<'data> FileInfo<'data>
Sourcepub fn new(dir: Cow<'data, [u8]>, name: Cow<'data, [u8]>) -> Self
pub fn new(dir: Cow<'data, [u8]>, name: Cow<'data, [u8]>) -> Self
Creates a FileInfo with a given directory and the file name.
Sourcepub fn from_path(path: &'data [u8]) -> Self
pub fn from_path(path: &'data [u8]) -> Self
Creates a FileInfo from a joined path by trying to split it.
Sourcepub fn from_filename(name: &'data [u8]) -> Self
pub fn from_filename(name: &'data [u8]) -> Self
Creates a FileInfo with the file name.
Sourcepub fn dir_str(&self) -> Cow<'data, str>
pub fn dir_str(&self) -> Cow<'data, str>
Path to the file relative to the compilation directory.
Sourcepub fn path_str(&self) -> String
pub fn path_str(&self) -> String
The full path to the file, relative to the compilation directory.
Sourcepub fn srcsrv_name_str(&self) -> Option<Cow<'data, str>>
pub fn srcsrv_name_str(&self) -> Option<Cow<'data, str>>
The file name on the source server as UTF-8 string.
This only exists if we have a debug file containing source server information.
Sourcepub fn srcsrv_dir_str(&self) -> Option<Cow<'data, str>>
pub fn srcsrv_dir_str(&self) -> Option<Cow<'data, str>>
Path to the file on the source server.
This only exists if we have a debug file containing source server information.
Sourcepub fn srcsrv_path_str(&self) -> Option<String>
pub fn srcsrv_path_str(&self) -> Option<String>
The full path to the file on the source server.
This only exists if we have a debug file containing source server information.
Sourcepub fn srcsrv_revision(&self) -> Option<&str>
pub fn srcsrv_revision(&self) -> Option<&str>
The optional VCS revision (e.g., Perforce changelist, git commit hash).
This only exists if we have a debug file containing source server information.
Trait Implementations§
impl<'data> Eq for FileInfo<'data>
impl<'data> StructuralPartialEq for FileInfo<'data>
Auto Trait Implementations§
impl<'data> Freeze for FileInfo<'data>
impl<'data> RefUnwindSafe for FileInfo<'data>
impl<'data> Send for FileInfo<'data>
impl<'data> Sync for FileInfo<'data>
impl<'data> Unpin for FileInfo<'data>
impl<'data> UnsafeUnpin for FileInfo<'data>
impl<'data> UnwindSafe for FileInfo<'data>
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§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.