pub trait ProviderAdapter: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn capabilities(&self) -> Capabilities;
fn encode_request(
&self,
surface: Surface,
request: ProviderRequest,
) -> Result<Value, ProviderError>;
fn decode_response(
&self,
surface: Surface,
response: Value,
) -> Result<ProviderResponse, ProviderError>;
fn stream_decoder(
&self,
surface: Surface,
) -> Result<Box<dyn ProviderStreamDecoder>, ProviderError>;
}Required Methods§
fn name(&self) -> &'static str
fn capabilities(&self) -> Capabilities
fn encode_request( &self, surface: Surface, request: ProviderRequest, ) -> Result<Value, ProviderError>
fn decode_response( &self, surface: Surface, response: Value, ) -> Result<ProviderResponse, ProviderError>
fn stream_decoder( &self, surface: Surface, ) -> Result<Box<dyn ProviderStreamDecoder>, ProviderError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".