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]

Convert this FileRef to a PathBuf, for use with OS file actions.

#[must_use]
pub fn rel(&self) -> &str
[src]

Convert this FileRef to a relative path (as a &str).

#[must_use]
pub fn ptr(&self) -> *const PathBuf
[src]

Get a pointer to this allocation, for use in hashing.

#[must_use]
pub fn ptr_eq(&self, other: &FileRef) -> bool
[src]

Compare this with other for pointer equality.

#[must_use]
pub fn has_extension(&self, ext: &str) -> bool
[src]

Returns 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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[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]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.