Struct FileSystemResolver

Source
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 Default for FileSystemResolver

Source§

fn default() -> FileSystemResolver

Returns the “default value” for a type. Read more
Source§

impl SourceResolver for FileSystemResolver

Source§

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

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

fn resolve_raw_path(&self, path: &Path, included_from: Option<&Path>) -> PathBuf

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: &Path) -> Result<PathBuf, SourceLoadError>

If necessary, canonicalize this path. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.