pub struct FileSystemResolver { /* private fields */ }
Expand description

An implementation of SourceResolver for the local file system.

This is the common case.

Implementations§

source§

impl FileSystemResolver

source

pub fn new(project_root: PathBuf) -> Self

Create a new resolver with the provided root directory.

If compiling from a UFO, the root directory is the UFO directory. In other cases, it is likely the directory containing the root feature file. If the path is empty (i.e. “”), the current working directory is assumed.

Trait Implementations§

source§

impl SourceResolver for FileSystemResolver

source§

fn get_contents(&self, path: &OsStr) -> Result<Arc<str>, SourceLoadError>

Return the contents of the utf-8 encoded file at the provided path.
source§

fn resolve_raw_path( &self, path: &OsStr, included_from: Option<&OsStr> ) -> OsString

Given a raw path (the $path in include($path)), return the path to load. The final path may differ based on which file the include statement occurs in; the path of the including file (if this is not the root source) is passed as the second argument. Read more
source§

fn canonicalize(&self, path: &OsStr) -> Result<OsString, SourceLoadError>

If necessary, canonicalize this path. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<U, T> ToOwnedObj<U> for Twhere U: FromObjRef<T>,

source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
source§

impl<U, T> ToOwnedTable<U> for Twhere U: FromTableRef<T>,

source§

fn to_owned_table(&self) -> U

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.