Skip to main content

Config

Struct Config 

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

Implementations§

Source§

impl Config

Auto-generated by derive_getters::Getters.

Source

pub fn path(&self) -> &PathBuf

Get field path from instance of Config.

Source

pub fn vhooks(&self) -> &Option<Vhooks>

Get field vhooks from instance of Config.

Source

pub fn semver_release(&self) -> &Option<SemverRelease>

Get field semver_release from instance of Config.

Source

pub fn pre_commit(&self) -> &Option<PreCommit>

Get field pre_commit from instance of Config.

Source

pub fn licenses(&self) -> &Option<Licenses>

Get field licenses from instance of Config.

Source

pub fn github_workflows(&self) -> &Option<GithubWorkflows>

Get field github_workflows from instance of Config.

Source

pub fn commitalyzer(&self) -> &Option<Commitalyzer>

Get field commitalyzer from instance of Config.

Source

pub fn cargo_deny(&self) -> &Option<CargoDeny>

Get field cargo_deny from instance of Config.

Source§

impl Config

Source

pub fn set_path(self, value: PathBuf) -> Self

Source

pub fn set_vhooks(self, value: Option<Vhooks>) -> Self

Source

pub fn set_semver_release(self, value: Option<SemverRelease>) -> Self

Source

pub fn set_pre_commit(self, value: Option<PreCommit>) -> Self

Source

pub fn set_licenses(self, value: Option<Licenses>) -> Self

Source

pub fn set_github_workflows(self, value: Option<GithubWorkflows>) -> Self

Source

pub fn set_commitalyzer(self, value: Option<Commitalyzer>) -> Self

Source

pub fn set_cargo_deny(self, value: Option<CargoDeny>) -> Self

Source§

impl Config

Source

pub fn new( path: PathBuf, vhooks: Option<Vhooks>, semver_release: Option<SemverRelease>, pre_commit: Option<PreCommit>, licenses: Option<Licenses>, github_workflows: Option<GithubWorkflows>, commitalyzer: Option<Commitalyzer>, cargo_deny: Option<CargoDeny>, ) -> Self

Source

pub fn new_empty(dest: &Path) -> Self

Source

pub fn on_all<F>(&mut self, f: F)
where F: FnMut(&mut dyn ToolTrait),

Source

pub fn try_all<F>(&mut self, f: F) -> Result<(), SolarError>
where F: FnMut(&mut dyn ToolTrait) -> Result<(), SolarError>,

Source

pub fn load_from_file(file_path: &Path) -> Result<Self, SolarError>

Creates a new Config from a file at the supplied path, provided the file contains valid syntax for JSON and the config.

Source

pub fn load_from(file_path: &Path) -> Result<Self, SolarError>

Source

pub fn load_or_default(file_path: &Path) -> Self

Source

pub fn save_to_file(&self, file_path: &Path) -> Result<(), SolarError>

Source

pub fn save_to(&self, file_path: &Path) -> Result<(), SolarError>

Source

pub fn save(&self) -> Result<(), SolarError>

Source

pub fn is_empty(&self) -> bool

Trait Implementations§

Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Config

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Config

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToolTrait for Config

Source§

fn set_dest(&mut self, dest: &Path)

Source§

fn act( &mut self, action: &Action, dest: Option<&Path>, ) -> Result<(), SolarError>

Source§

fn install(&mut self) -> Result<(), SolarError>

Source§

fn upgrade(&mut self) -> Result<(), SolarError>

Source§

fn uninstall(&mut self) -> Result<(), SolarError>

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more