Struct Import

Source
pub struct Import<'a, S, P> {
    pub parent: &'a P,
    pub path: &'a S,
    pub meta: &'a Option<Term<S>>,
}
Expand description

Information to resolve module/data imports.

Fields§

§parent: &'a P

absolute path of the module where the import/include directive appears

This is a path P, not a string S, because it usually does not appear in the source.

§path: &'a S

relative path of the imported/included module, as given in the source

§meta: &'a Option<Term<S>>

metadata attached to the import/include directive

Implementations§

Source§

impl<'a> Import<'a, &'a str, PathBuf>

Source

pub fn find(self, paths: &[PathBuf], ext: &str) -> Result<PathBuf, String>

Try to find a file with given extension in the given search paths.

Auto Trait Implementations§

§

impl<'a, S, P> Freeze for Import<'a, S, P>

§

impl<'a, S, P> RefUnwindSafe for Import<'a, S, P>

§

impl<'a, S, P> Send for Import<'a, S, P>
where P: Sync, S: Sync,

§

impl<'a, S, P> Sync for Import<'a, S, P>
where P: Sync, S: Sync,

§

impl<'a, S, P> Unpin for Import<'a, S, P>

§

impl<'a, S, P> UnwindSafe for Import<'a, S, P>

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<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.