Struct BurnConfig
pub struct BurnConfig { /* private fields */ }Expand description
Represents the global configuration for Burn.
Implementations§
§impl BurnConfig
impl BurnConfig
Trait Implementations§
§impl Clone for BurnConfig
impl Clone for BurnConfig
§fn clone(&self) -> BurnConfig
fn clone(&self) -> BurnConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for BurnConfig
impl Debug for BurnConfig
§impl Default for BurnConfig
impl Default for BurnConfig
§fn default() -> BurnConfig
fn default() -> BurnConfig
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for BurnConfig
impl<'de> Deserialize<'de> for BurnConfig
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BurnConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BurnConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl RuntimeConfig for BurnConfig
impl RuntimeConfig for BurnConfig
§fn storage() -> &'static Mutex<Option<Arc<BurnConfig>>>
fn storage() -> &'static Mutex<Option<Arc<BurnConfig>>>
Global storage for the configuration singleton. Read more
§fn file_names() -> &'static [&'static str]
fn file_names() -> &'static [&'static str]
File names searched in each directory during [
Config::from_current_dir]. Read more§fn override_from_env(self) -> BurnConfig
fn override_from_env(self) -> BurnConfig
Hook to override fields from environment variables after loading from disk. Read more
§fn section_file_names() -> &'static [(&'static str, &'static str)]
fn section_file_names() -> &'static [(&'static str, &'static str)]
File names searched in each directory, where only a specific TOML section is loaded
instead of the whole file. Read more
§fn on_loaded(&self)
fn on_loaded(&self)
Hook invoked exactly once, when the configuration singleton is first
initialized — whether loaded from disk in [
RuntimeConfig::get] or
installed with [RuntimeConfig::set] / [RuntimeConfig::try_set]. Read more§fn get() -> Arc<Self> ⓘ
fn get() -> Arc<Self> ⓘ
Retrieves the current configuration, loading it from the current directory if not set. Read more
§fn try_set(config: Self) -> bool
fn try_set(config: Self) -> bool
Sets the configuration to the provided value, unless it has already been
set or read — in which case the existing configuration is kept and
false is returned. Read more§fn save_default<P>(path: P) -> Result<(), Error>
fn save_default<P>(path: P) -> Result<(), Error>
Save the default configuration to the provided file path.
§fn from_current_dir() -> Self
fn from_current_dir() -> Self
Loads configuration from any of [
Config::file_names] in the current directory or its
parents. Read more§fn from_file_path<P>(path: P) -> Result<Self, Error>
fn from_file_path<P>(path: P) -> Result<Self, Error>
Loads configuration from a specified file path. Read more
§impl Serialize for BurnConfig
impl Serialize for BurnConfig
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for BurnConfig
impl RefUnwindSafe for BurnConfig
impl Send for BurnConfig
impl Sync for BurnConfig
impl Unpin for BurnConfig
impl UnsafeUnpin for BurnConfig
impl UnwindSafe for BurnConfig
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§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>
Converts
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>
Converts
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().