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: PluginDependencyHandle,
operation: String,
request: Value,
context: InvocationContext,
) -> JsonHostRequestFuture { ... }
fn open_host_stream(
&self,
dependency: PluginStreamDependencyHandle,
operation: String,
request: Value,
context: InvocationContext,
) -> JsonHostStreamOpenFuture { ... }
}Expand description
Generated typed-value bridge shared by byte-oriented Execution Adapters.
Required Methods§
Sourcefn capability_id(&self) -> &'static str
fn capability_id(&self) -> &'static str
Stable Capability series identity.
Sourcefn descriptor_version(&self) -> &'static str
fn descriptor_version(&self) -> &'static str
Exact Descriptor version.
Sourcefn request_operations(&self) -> &'static [&'static str]
fn request_operations(&self) -> &'static [&'static str]
Exact request Operation table.
Sourcefn encode_request(
&self,
operation: &str,
request: &dyn Any,
) -> Result<Value, RuntimeFailure>
fn encode_request( &self, operation: &str, request: &dyn Any, ) -> Result<Value, RuntimeFailure>
Converts one generated request into validated portable JSON.
Sourcefn decode_response(
&self,
operation: &str,
value: Value,
) -> Result<Box<dyn Any>, RuntimeFailure>
fn decode_response( &self, operation: &str, value: Value, ) -> Result<Box<dyn Any>, RuntimeFailure>
Converts portable JSON into the generated response value.
Sourcefn decode_domain_error(
&self,
operation: &str,
value: Value,
) -> Result<Box<dyn Any>, RuntimeFailure>
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§
Sourcefn stream_operations(&self) -> &'static [&'static str]
fn stream_operations(&self) -> &'static [&'static str]
Exact bidirectional stream Operation table.
Sourcefn encode_stream_open(
&self,
operation: &str,
request: &dyn Any,
) -> Result<Value, RuntimeFailure>
fn encode_stream_open( &self, operation: &str, request: &dyn Any, ) -> Result<Value, RuntimeFailure>
Converts one generated stream-open request into validated portable JSON.
Sourcefn encode_stream_message(
&self,
operation: &str,
message: &dyn Any,
) -> Result<Value, RuntimeFailure>
fn encode_stream_message( &self, operation: &str, message: &dyn Any, ) -> Result<Value, RuntimeFailure>
Converts one generated outbound stream message into validated portable JSON.
Sourcefn decode_stream_message(
&self,
operation: &str,
value: Value,
) -> Result<Box<dyn Any>, RuntimeFailure>
fn decode_stream_message( &self, operation: &str, value: Value, ) -> Result<Box<dyn Any>, RuntimeFailure>
Converts one portable JSON stream message into its generated value.
Sourcefn decode_stream_domain_error(
&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>
Converts one portable JSON stream terminal error into its generated value.
Sourcefn invoke_host_request(
&self,
dependency: PluginDependencyHandle,
operation: String,
request: Value,
context: InvocationContext,
) -> JsonHostRequestFuture
fn invoke_host_request( &self, dependency: PluginDependencyHandle, operation: String, request: Value, context: InvocationContext, ) -> JsonHostRequestFuture
Invokes one exact Plan-bound host Request dependency from portable JSON.
Sourcefn open_host_stream(
&self,
dependency: PluginStreamDependencyHandle,
operation: String,
request: Value,
context: InvocationContext,
) -> JsonHostStreamOpenFuture
fn open_host_stream( &self, dependency: PluginStreamDependencyHandle, 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".