Struct ResourceDir

Source
pub struct ResourceDir { /* private fields */ }
Expand description

Resource dir.

A builder structure allows to change default settings for:

  • file filter
  • generated file name
  • generated function name

Implementations§

Source§

impl ResourceDir

Source

pub fn build(self) -> Result<()>

Generates resources for current configuration.

Source

pub fn with_filter(&mut self, filter: fn(p: &Path) -> bool) -> &mut Self

Sets the file filter.

Source

pub fn with_generated_filename<P: AsRef<Path>>( &mut self, generated_filename: P, ) -> &mut Self

Sets the generated filename.

Source

pub fn with_generated_fn<S>(&mut self, generated_fn: S) -> &mut Self
where S: Into<String>,

Sets the generated function name.

Source

pub fn with_module_name<S>(&mut self, module_name: S) -> &mut Self
where S: Into<String>,

Sets the generated module name.

Default value is based on generated function name and the suffix “sets”. Generated module would be overriden by each call.

Source

pub fn with_count_per_module(&mut self, count_per_module: usize) -> &mut Self

Sets maximal count of files per module.

Trait Implementations§

Source§

impl Default for ResourceDir

Source§

fn default() -> ResourceDir

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

impl From<NpmBuild> for ResourceDir

Source§

fn from(npm_build: NpmBuild) -> Self

Converts to this type from the input type.

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