pub struct Config { /* private fields */ }Implementations§
Source§impl Config
impl Config
Sourcepub fn build(self) -> Result<LogManager, ServiceError>
pub fn build(self) -> Result<LogManager, ServiceError>
Builds the LogManager by borrowing the configuration.
This method is ideal consumes the Config object. Normally the configuration
object will be loaded from a file or elsewhere in order to build the LogManager
and then discarded. Note that Config implements Clone in case a persistent
copy is needed.
§Behavior
- Takes ownership of
self. - Moves internal data (like strings and configs) into the loggers.
§Errors
Returns ServiceError if:
- A file cannot be opened with “write + append” permissions.
- A channel requires a feature that was not compiled in.
- Other nondescript errors.
Sourcepub fn get_entry<Q>(&self, channel: &Q) -> Option<&Entry>
pub fn get_entry<Q>(&self, channel: &Q) -> Option<&Entry>
Returns a reference to the configuration entry for the specified channel.
Accepts any type that can be referenced as a string (e.g., &str or String).
Sourcepub fn get_entry_mut<Q>(&mut self, channel: &Q) -> Option<&mut Entry>
pub fn get_entry_mut<Q>(&mut self, channel: &Q) -> Option<&mut Entry>
Returns a mutable reference to the configuration entry for the specified channel.
Sourcepub fn remove_entry<Q>(&mut self, channel: &Q) -> Option<Entry>
pub fn remove_entry<Q>(&mut self, channel: &Q) -> Option<Entry>
Removes a channel from the configuration and returns its entry, if it existed.
Sourcepub fn insert_entry<S>(&mut self, channel: S, entry: Entry)
pub fn insert_entry<S>(&mut self, channel: S, entry: Entry)
Inserts a raw configuration entry for a specific channel. If the channel already exists, the old configuration is overwritten.
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more