pub trait TokenResolver: Send + Sync {
// Required methods
fn can_resolve(&self, token: &str) -> bool;
fn resolve_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token: &'life1 str,
context: &'life2 ResolutionContext,
) -> Pin<Box<dyn Future<Output = Result<String, PluginError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_metadata(&self) -> PluginMetadata;
// Provided method
fn validate(&self) -> Result<(), PluginError> { ... }
}
Expand description
Async token resolver trait for plugins
Required Methods§
Sourcefn can_resolve(&self, token: &str) -> bool
fn can_resolve(&self, token: &str) -> bool
Check if this resolver can handle a given token
Sourcefn resolve_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token: &'life1 str,
context: &'life2 ResolutionContext,
) -> Pin<Box<dyn Future<Output = Result<String, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
token: &'life1 str,
context: &'life2 ResolutionContext,
) -> Pin<Box<dyn Future<Output = Result<String, PluginError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Resolve a token to its value asynchronously
Sourcefn get_metadata(&self) -> PluginMetadata
fn get_metadata(&self) -> PluginMetadata
Get plugin metadata
Provided Methods§
Sourcefn validate(&self) -> Result<(), PluginError>
fn validate(&self) -> Result<(), PluginError>
Validate plugin configuration