Skip to main content

Resolver

Trait Resolver 

Source
pub trait Resolver: Send + Sync {
    // Required method
    fn resolve<'a>(
        &'a self,
        query: &'a Query,
        ctx: &'a Context,
    ) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'a>>;
}
Expand description

Resolver for queries against a resource. Implementations are domain-specific (storage, analysis, telemetry).

This trait is dyn-compatible: resolve returns a boxed future so that transport adapters can hold Arc<dyn Resolver>.

Required Methods§

Source

fn resolve<'a>( &'a self, query: &'a Query, ctx: &'a Context, ) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'a>>

Resolve a query against this resolver’s resource.

§Errors

Returns Error if the query cannot be fulfilled.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<T> Resolver for T
where T: ResolverBoxed + ?Sized,