pub trait ResolverHandler:
Send
+ Sync
+ 'static {
// Required methods
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 RequestContext,
application: InitializeApplication,
) -> Pin<Box<dyn Future<Output = RpcResult<InitializedApplication>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get<'life0, 'async_trait>(
&'life0 self,
context: RequestContext,
params: GetParams,
) -> Pin<Box<dyn Future<Output = RpcResult<GetResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn release<'life0, 'async_trait>(
&'life0 self,
context: RequestContext,
params: ReleaseParams,
) -> Pin<Box<dyn Future<Output = RpcResult<ReleaseResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn capabilities(&self) -> Vec<String> { ... }
fn set<'life0, 'async_trait>(
&'life0 self,
_context: RequestContext,
_params: SetParams,
) -> Pin<Box<dyn Future<Output = RpcResult<SetResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn delete<'life0, 'async_trait>(
&'life0 self,
_context: RequestContext,
_params: DeleteParams,
) -> Pin<Box<dyn Future<Output = RpcResult<DeleteResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn request_finished<'life0, 'async_trait>(
&'life0 self,
_request_id: RequestId,
_committed: bool,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Typed northbound handler. Implementations never parse JSON-RPC envelopes or arbitrate cancellation/terminal races.
For connected streams (0.21+), the embedding host authenticates and authorizes the transport before dispatch. Its per-session handler must check initialization against server-owned policy before opening manifests or providers. Initialization context is not authenticated identity. Each connection needs isolated configuration and resource ownership.
Required Methods§
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 RequestContext,
application: InitializeApplication,
) -> Pin<Box<dyn Future<Output = RpcResult<InitializedApplication>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
context: RequestContext,
params: GetParams,
) -> Pin<Box<dyn Future<Output = RpcResult<GetResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn release<'life0, 'async_trait>(
&'life0 self,
context: RequestContext,
params: ReleaseParams,
) -> Pin<Box<dyn Future<Output = RpcResult<ReleaseResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Provided Methods§
Sourcefn capabilities(&self) -> Vec<String>
fn capabilities(&self) -> Vec<String>
Methods this endpoint advertises. The default is resolution only, so an endpoint gains a mutation method by naming it here and implementing it, never by inheriting one it never considered.
Sourcefn set<'life0, 'async_trait>(
&'life0 self,
_context: RequestContext,
_params: SetParams,
) -> Pin<Box<dyn Future<Output = RpcResult<SetResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set<'life0, 'async_trait>(
&'life0 self,
_context: RequestContext,
_params: SetParams,
) -> Pin<Box<dyn Future<Output = RpcResult<SetResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store one declared name (0.21+). Unreachable unless
Self::capabilities advertises resolver.set: the server answers an
unadvertised method itself and never reaches the handler.
Sourcefn delete<'life0, 'async_trait>(
&'life0 self,
_context: RequestContext,
_params: DeleteParams,
) -> Pin<Box<dyn Future<Output = RpcResult<DeleteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
_context: RequestContext,
_params: DeleteParams,
) -> Pin<Box<dyn Future<Output = RpcResult<DeleteResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove one declared name’s stored value (0.21+), advertised as
resolver.delete under the same rule as Self::set.
fn request_finished<'life0, 'async_trait>(
&'life0 self,
_request_id: RequestId,
_committed: bool,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".