Skip to main content

DEFAULT_TOKEN

Constant DEFAULT_TOKEN 

Source
pub const DEFAULT_TOKEN: &str = "";
Expand description

The default (unnamed) provider token.

Use this when registering or resolving a provider that does not need to be differentiated from other providers of the same type. Passing "" is identical.

builder.register(DEFAULT_TOKEN, DynProvider::sync(|| Ok(Client::new())));
let client: Client = container.resolve_external_with_token(DEFAULT_TOKEN).await?;
// equivalent:
let client: Client = container.resolve_external::<Client>().await?;