Struct mm0_util::FileRef [−][src]
pub struct FileRef(_);
A reference to a file. It wraps an Arc
so it can be cloned thread-safely.
A FileRef
can be constructed either from a PathBuf
or a
(file://
) Url
,
and provides (precomputed) access to these views using
path()
and url()
, as well as
rel()
to get the relative path from CURRENT_DIR
.
Implementations
impl FileRef
[src]
impl FileRef
[src]#[must_use]pub fn path(&self) -> &PathBuf
[src]
#[must_use]
pub fn path(&self) -> &PathBuf#[must_use]pub fn rel(&self) -> &str
[src]
#[must_use]
pub fn rel(&self) -> &strConvert this FileRef
to a relative path (as a &str
).
#[must_use]pub fn ptr(&self) -> *const PathBuf
[src]
#[must_use]
pub fn ptr(&self) -> *const PathBufGet a pointer to this allocation, for use in hashing.
#[must_use]pub fn ptr_eq(&self, other: &FileRef) -> bool
[src]
#[must_use]
pub fn ptr_eq(&self, other: &FileRef) -> boolCompare this with other
for pointer equality.
#[must_use]pub fn has_extension(&self, ext: &str) -> bool
[src]
#[must_use]
pub fn has_extension(&self, ext: &str) -> boolReturns true if this file has the provided extension.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for FileRef
impl RefUnwindSafe for FileRef
impl UnwindSafe for FileRef
impl UnwindSafe for FileRef