Configuration

Struct Configuration 

Source
pub struct Configuration {
    pub template: TemplateSource,
    pub cargo_lock_path: PathBuf,
    pub target_path: Option<PathBuf>,
    pub post_template_search: Option<String>,
    pub post_template_replace: String,
    pub include_root: bool,
    pub maximum_depth: Option<usize>,
}
Expand description

Configuration struct

  • template can be either a File or Text
  • cargo_lock_path is the path to Cargo.lock (filled by default)
  • target_path if not specified is deduced for template (if template is specified as File) by removing the .template.` name part.
  • post_template_search / post_template_replace allows to perform a post template replacement (to perform cleanup)
  • include_root if the root crate (the one currently being built) has to be included
  • maximum_depth when specified allows to limit recursion (the only interest here is probably 1)

Fields§

§template: TemplateSource§cargo_lock_path: PathBuf§target_path: Option<PathBuf>§post_template_search: Option<String>§post_template_replace: String§include_root: bool§maximum_depth: Option<usize>

Implementations§

Trait Implementations§

Source§

impl Default for Configuration

Source§

fn default() -> Self

Default values for Configuration are

  • template: TemplateSource::File(“src/deps.template.rs”.into()), read template from src/deps.template.rs
  • cargo_lock_path: the Cargo.lock (how surprising 😅)
  • target_path: None (will be deduced from source path)
  • post_template_search / post_template_replace: "//{}" / "" (meaning //{} is removed)
  • include_root: false
  • maximum_depth: None

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

impl<T> ErasedDestructor for T
where T: 'static,