[−][src]Struct spirit::Builder
The builder of Spirit
.
This is returned by the Spirit::new
.
Interface
Most of the methods are available through the following traits. You want to bring them into
scope (possibly by use spirit::prelude::*
) and look at their methods.
ConfigBuilder
to specify how configuration should be loaded.Extensible
to register callbacks.SpiritBuilder
to turn the builder intoSpirit
.
Methods
impl<O, C> Builder<O, C> where
C: DeserializeOwned + Send + Sync + 'static,
O: StructOpt + Sync + Send + 'static,
[src]
C: DeserializeOwned + Send + Sync + 'static,
O: StructOpt + Sync + Send + 'static,
pub fn config_loader(self, loader: CfgBuilder) -> Self
[src]
Trait Implementations
impl<O, C> ConfigBuilder for Builder<O, C>
[src]
fn config_default_paths<P, I>(self, paths: I) -> Self where
I: IntoIterator<Item = P>,
P: Into<PathBuf>,
[src]
I: IntoIterator<Item = P>,
P: Into<PathBuf>,
fn config_defaults<D: Into<String>>(self, config: D) -> Self
[src]
fn config_env<E: Into<String>>(self, env: E) -> Self
[src]
fn config_filter<F: FnMut(&Path) -> bool + Send + 'static>(
self,
filter: F
) -> Self
[src]
self,
filter: F
) -> Self
fn config_defaults_typed<C: Serialize>(self, config: &C) -> Result<Self, Error>
[src]
Specifies the default configuration as typed value. Read more
fn config_ext<E: Into<OsString>>(self, ext: E) -> Self
[src]
Configures a config dir filter for a single extension. Read more
fn config_exts<I, E>(self, exts: I) -> Self where
I: IntoIterator<Item = E>,
E: Into<OsString>,
[src]
I: IntoIterator<Item = E>,
E: Into<OsString>,
Configures a config dir filter for multiple extensions. Read more
impl<O, C> Extensible for Builder<O, C>
[src]
type Opts = O
The command line options structure tied to this instance. Read more
type Config = C
The configuration structure. Read more
type Ok = Self
The Ok variant used when returning a result. Read more
const STARTED: bool
[src]
fn before_config<F>(self, cback: F) -> Result<Self, Error> where
F: FnOnce(&C, &O) -> Result<(), Error> + Send + 'static,
[src]
F: FnOnce(&C, &O) -> Result<(), Error> + Send + 'static,
fn config_validator<F>(self, f: F) -> Result<Self, Error> where
F: FnMut(&Arc<C>, &Arc<C>, &O) -> Result<Action, Error> + Send + 'static,
[src]
F: FnMut(&Arc<C>, &Arc<C>, &O) -> Result<Action, Error> + Send + 'static,
fn config_mutator<F>(self, f: F) -> Self where
F: FnMut(&mut C) + Send + 'static,
[src]
F: FnMut(&mut C) + Send + 'static,
fn on_config<F: FnMut(&O, &Arc<C>) + Send + 'static>(self, hook: F) -> Self
[src]
fn on_signal<F>(self, signal: c_int, hook: F) -> Result<Self, Error> where
F: FnMut() + Send + 'static,
[src]
F: FnMut() + Send + 'static,
fn on_terminate<F: FnOnce() + Send + 'static>(self, hook: F) -> Self
[src]
fn with<E>(self, ext: E) -> Result<Self::Ok, Error> where
E: Extension<Self>,
[src]
E: Extension<Self>,
fn singleton<T: 'static>(&mut self) -> bool
[src]
fn run_before<B>(self, body: B) -> Result<Self, Error> where
B: FnOnce(&Arc<Spirit<O, C>>) -> Result<(), Error> + Send + 'static,
[src]
B: FnOnce(&Arc<Spirit<O, C>>) -> Result<(), Error> + Send + 'static,
fn run_around<W>(self, wrapper: W) -> Result<Self, Error> where
W: FnOnce(&Arc<Spirit<O, C>>, InnerBody) -> Result<(), Error> + Send + 'static,
[src]
W: FnOnce(&Arc<Spirit<O, C>>, InnerBody) -> Result<(), Error> + Send + 'static,
fn with_singleton<T>(self, singleton: T) -> Result<Self, Error> where
T: Extension<Self::Ok> + 'static,
[src]
T: Extension<Self::Ok> + 'static,
fn keep_guard<G: Any + Send>(self, guard: G) -> Self
[src]
fn autojoin_bg_thread(self) -> Self
[src]
impl<O, C> SpiritBuilder for Builder<O, C> where
Self::Config: DeserializeOwned + Send + Sync + 'static,
Self::Opts: StructOpt + Sync + Send + 'static,
[src]
Self::Config: DeserializeOwned + Send + Sync + 'static,
Self::Opts: StructOpt + Sync + Send + 'static,
Auto Trait Implementations
impl<O, C> Send for Builder<O, C> where
C: Send,
O: Send,
C: Send,
O: Send,
impl<O = Empty, C = Empty> !Sync for Builder<O, C>
Blanket Implementations
impl<T> IntoResult for T
[src]
fn into_result(Self) -> Result<T, Error>
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.