Skip to main content

Bindable

Derive Macro Bindable 

Source
#[derive(Bindable)]
Expand description

Derives [secrets_rs::Bindable] for a struct.

All fields whose type is Secret<T> (or any path ending in Secret) will have .bind(registry) called on them. All other fields are ignored.

ยงExample

โ“˜
use secrets_rs::{Secret, bind_all, EnvSource, SourceRegistry};

#[derive(secrets_rs::Bindable)]
struct Config {
    api_key:  Secret<String>,
    timeout:  u32,           // ignored โ€” not a Secret
}