pub struct ContextCallbackHandler { /* private fields */ }Expand description
Context Callback Handler
Handles context callback requests from external extension services.
Implementations§
Source§impl ContextCallbackHandler
impl ContextCallbackHandler
Sourcepub fn new(security: Arc<SecurityValidator>) -> Self
pub fn new(security: Arc<SecurityValidator>) -> Self
Create a new context callback handler
Sourcepub fn with_namespace_config(self, config: ContextNamespaceConfig) -> Self
pub fn with_namespace_config(self, config: ContextNamespaceConfig) -> Self
Set namespace configuration
Sourcepub async fn initialize_context(
&self,
namespace: &str,
data: HashMap<String, JsonValue>,
)
pub async fn initialize_context( &self, namespace: &str, data: HashMap<String, JsonValue>, )
Initialize with existing context
Sourcepub async fn handle(
&self,
request: ContextCallbackRequest,
) -> Result<ContextCallbackResult, ContextCallbackError>
pub async fn handle( &self, request: ContextCallbackRequest, ) -> Result<ContextCallbackResult, ContextCallbackError>
Handle a context callback request
Sourcepub fn create_error_response(
&self,
error: ContextCallbackError,
id: JsonRpcId,
) -> JsonRpcResponse
pub fn create_error_response( &self, error: ContextCallbackError, id: JsonRpcId, ) -> JsonRpcResponse
Create a JSON-RPC error response for context callback failures
Sourcepub fn get_available_namespaces(&self, service_id: &ServiceId) -> Vec<String>
pub fn get_available_namespaces(&self, service_id: &ServiceId) -> Vec<String>
Get all available namespaces for a service
Auto Trait Implementations§
impl !RefUnwindSafe for ContextCallbackHandler
impl !UnwindSafe for ContextCallbackHandler
impl Freeze for ContextCallbackHandler
impl Send for ContextCallbackHandler
impl Sync for ContextCallbackHandler
impl Unpin for ContextCallbackHandler
impl UnsafeUnpin for ContextCallbackHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more