Struct IncludePathsBuilder

Source
pub struct IncludePathsBuilder { /* private fields */ }

Implementations§

Source§

impl IncludePathsBuilder

Source

pub fn new() -> Self

Create new builder

Source

pub fn include_known(&mut self, path: &str) -> &mut Self

Add another include directory that we know the path to seek into The directories are considered to be absolute if starting with / or relative to current folder otherwise You can chain multiple calls

Source

pub fn include_exe_dir(&mut self) -> &mut Self

Add current executable directory to seek into You can chain multiple calls

Source

pub fn include_unknown(&mut self, path: &str) -> &mut Self

Add another include directory that we do not know the path to, to seek into We will start seeking the directory first by backtracing from the the current folder until we reach the $HOME directory. Once we find the directory, then we will check inside for the files. Useful for testing inside project data. For example cargo test will execute from the ./target folder and you have your test data inside a config folder somewhere in your project. The same fodler will be deployed in a subfolder next to the binary in deployment. You can use this function to include the config folder as unknown and the code will discover the directory by itself. This feature is useful to avoid having multiple includes with ../.. etc to cover all scenarios. You can chain multiple calls

Source

pub fn build(&mut self) -> IncludePaths

Trait Implementations§

Source§

impl Default for IncludePathsBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. 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<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V