[−][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
.
Implementations
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 warn_on_unused(self, warn: bool) -> Self
[src]
fn config_defaults_typed<C: Serialize>(
self,
config: &C
) -> Result<Self, AnyError>
[src]
self,
config: &C
) -> Result<Self, AnyError>
fn config_ext<E: Into<OsString>>(self, ext: E) -> Self
[src]
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>,
fn config_supported_exts(self) -> Self
[src]
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, AnyError> where
F: FnOnce(&C, &O) -> Result<(), AnyError> + Send + 'static,
[src]
F: FnOnce(&C, &O) -> Result<(), AnyError> + Send + 'static,
fn config_validator<F>(self, f: F) -> Result<Self, AnyError> where
F: FnMut(&Arc<C>, &Arc<C>, &O) -> Result<Action, AnyError> + Send + 'static,
[src]
F: FnMut(&Arc<C>, &Arc<C>, &O) -> Result<Action, AnyError> + 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, AnyError> 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, AnyError> 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, AnyError> where
B: FnOnce(&Arc<Spirit<O, C>>) -> Result<(), AnyError> + Send + 'static,
[src]
B: FnOnce(&Arc<Spirit<O, C>>) -> Result<(), AnyError> + Send + 'static,
fn run_around<W>(self, wrapper: W) -> Result<Self, AnyError> where
W: FnOnce(&Arc<Spirit<O, C>>, Box<dyn FnOnce() -> Result<(), AnyError> + Send>) -> Result<(), AnyError> + Send + 'static,
[src]
W: FnOnce(&Arc<Spirit<O, C>>, Box<dyn FnOnce() -> Result<(), AnyError> + Send>) -> Result<(), AnyError> + Send + 'static,
fn around_hooks<W>(self, wrapper: W) -> Self where
W: HookWrapper,
[src]
W: HookWrapper,
fn with_singleton<T>(self, singleton: T) -> Result<Self, AnyError> 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, autojoin: Autojoin) -> 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 = Empty, C = Empty> !RefUnwindSafe for Builder<O, C>
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>
impl<O, C> Unpin for Builder<O, C> where
C: Unpin,
O: Unpin,
C: Unpin,
O: Unpin,
impl<O = Empty, C = Empty> !UnwindSafe for Builder<O, C>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,