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]
#[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
impl Clone for FileRef
[src]
impl Debug for FileRef
[src]
impl Display for FileRef
[src]
impl Eq for FileRef
[src]
impl From<PathBuf> for FileRef
[src]
impl Hash for FileRef
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<FileRef> for FileRef
[src]
Auto Trait Implementations
impl RefUnwindSafe for FileRef
impl Send for FileRef
impl Sync for FileRef
impl Unpin for FileRef
impl UnwindSafe for FileRef
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,