Skip to main content

FromCascade

Trait FromCascade 

Source
pub trait FromCascade:
    Default
    + Serialize
    + DeserializeOwned
    + 'static {
    // Provided method
    fn from_cascade_key(key: &str) -> Self { ... }
}
Available on crate feature transport only.
Expand description

Load a transport config from the cascade under a fixed key.

Consolidates the byte-identical from_cascade() bodies that each transport config previously repeated (try the cascade under a key, register the section, fall back to Default). Implementors only name their key; the loading logic lives here once. Without the config feature the default method just returns Default::default().

Provided Methods§

Source

fn from_cascade_key(key: &str) -> Self

Load Self from the config cascade under key, registering the section in the global registry; falls back to Default if the cascade is unavailable or the key is absent/invalid.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§