Skip to main content

JsonCapabilityCodec

Trait JsonCapabilityCodec 

Source
pub trait JsonCapabilityCodec: Debug + 'static {
Show 13 methods // Required methods fn capability_id(&self) -> &'static str; fn descriptor_version(&self) -> &'static str; fn request_operations(&self) -> &'static [&'static str]; fn encode_request( &self, operation: &str, request: &dyn Any, ) -> Result<Value, RuntimeFailure>; fn decode_response( &self, operation: &str, value: Value, ) -> Result<Box<dyn Any>, RuntimeFailure>; fn decode_domain_error( &self, operation: &str, value: Value, ) -> Result<Box<dyn Any>, RuntimeFailure>; // Provided methods fn stream_operations(&self) -> &'static [&'static str] { ... } fn encode_stream_open( &self, operation: &str, request: &dyn Any, ) -> Result<Value, RuntimeFailure> { ... } fn encode_stream_message( &self, operation: &str, message: &dyn Any, ) -> Result<Value, RuntimeFailure> { ... } fn decode_stream_message( &self, operation: &str, value: Value, ) -> Result<Box<dyn Any>, RuntimeFailure> { ... } fn decode_stream_domain_error( &self, operation: &str, value: Value, ) -> Result<Box<dyn Any>, RuntimeFailure> { ... } fn invoke_host_request( &self, dependency: ModuleDependencyHandle, operation: String, request: Value, context: InvocationContext, ) -> JsonHostRequestFuture { ... } fn open_host_stream( &self, dependency: ModuleStreamDependencyHandle, operation: String, request: Value, context: InvocationContext, ) -> JsonHostStreamOpenFuture { ... }
}
Expand description

Generated typed-value bridge shared by byte-oriented Execution Adapters.

Required Methods§

Source

fn capability_id(&self) -> &'static str

Stable Capability series identity.

Source

fn descriptor_version(&self) -> &'static str

Exact Descriptor version.

Source

fn request_operations(&self) -> &'static [&'static str]

Exact request Operation table.

Source

fn encode_request( &self, operation: &str, request: &dyn Any, ) -> Result<Value, RuntimeFailure>

Converts one generated request into validated portable JSON.

Source

fn decode_response( &self, operation: &str, value: Value, ) -> Result<Box<dyn Any>, RuntimeFailure>

Converts portable JSON into the generated response value.

Source

fn decode_domain_error( &self, operation: &str, value: Value, ) -> Result<Box<dyn Any>, RuntimeFailure>

Converts portable JSON into the generated Domain Error value.

Provided Methods§

Source

fn stream_operations(&self) -> &'static [&'static str]

Exact bidirectional stream Operation table.

Source

fn encode_stream_open( &self, operation: &str, request: &dyn Any, ) -> Result<Value, RuntimeFailure>

Converts one generated stream-open request into validated portable JSON.

Source

fn encode_stream_message( &self, operation: &str, message: &dyn Any, ) -> Result<Value, RuntimeFailure>

Converts one generated outbound stream message into validated portable JSON.

Source

fn decode_stream_message( &self, operation: &str, value: Value, ) -> Result<Box<dyn Any>, RuntimeFailure>

Converts one portable JSON stream message into its generated value.

Source

fn decode_stream_domain_error( &self, operation: &str, value: Value, ) -> Result<Box<dyn Any>, RuntimeFailure>

Converts one portable JSON stream terminal error into its generated value.

Source

fn invoke_host_request( &self, dependency: ModuleDependencyHandle, operation: String, request: Value, context: InvocationContext, ) -> JsonHostRequestFuture

Invokes one exact Plan-bound host Request dependency from portable JSON.

Source

fn open_host_stream( &self, dependency: ModuleStreamDependencyHandle, operation: String, request: Value, context: InvocationContext, ) -> JsonHostStreamOpenFuture

Opens one exact Plan-bound host Stream dependency from portable JSON.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§