pub struct Config {
pub client: ClientConfig,
pub generate: GenerateConfig,
pub manager: ManagerConfig,
pub server: ServerConfig,
}
Expand description
Represents configuration settings for all of distant
Fields
client: ClientConfig
generate: GenerateConfig
manager: ManagerConfig
server: ServerConfig
Implementations
sourceimpl Config
impl Config
sourcepub fn load_multi(custom: Option<PathBuf>) -> Result<Self>
pub fn load_multi(custom: Option<PathBuf>) -> Result<Self>
Loads the configuration from multiple sources in a blocking fashion
- If
custom
is provided, it is used by itself as the source for configuration - Otherwise, if
custom
is not provided, will attempt to load from global and user config files, merging together if they both exist - Otherwise if no
custom
path and none of the standard configuration paths exist, then the default configuration is returned instead
sourcepub async fn edit_if_exists(
path: impl AsRef<Path>,
f: impl FnOnce(&mut Document) -> Result<()>
) -> Result<()>
pub async fn edit_if_exists(
path: impl AsRef<Path>,
f: impl FnOnce(&mut Document) -> Result<()>
) -> Result<()>
Like edit
but will succeed without invoking f
if the path is not found
sourcepub async fn edit(
path: impl AsRef<Path>,
f: impl FnOnce(&mut Document) -> Result<()>
) -> Result<()>
pub async fn edit(
path: impl AsRef<Path>,
f: impl FnOnce(&mut Document) -> Result<()>
) -> Result<()>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> CompatExt for T
impl<T> CompatExt for T
fn compat_ref(&self) -> Compat<&T>
fn compat_ref(&self) -> Compat<&T>
Applies the [Compat
] adapter by shared reference. Read more
fn compat_mut(&mut self) -> Compat<&mut T>
fn compat_mut(&mut self) -> Compat<&mut T>
Applies the [Compat
] adapter by mutable reference. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more