pub trait SchemasApiServer<BlockHash>:
Sized
+ Send
+ Sync
+ 'static {
// Required methods
fn get_by_schema_id(
&self,
schema_id: SchemaId,
) -> RpcResult<Option<SchemaResponse>>;
fn check_schema_validity(
&self,
model: Vec<u8>,
at: Option<BlockHash>,
) -> RpcResult<bool>;
fn get_versions(
&self,
schema_name: String,
) -> RpcResult<Option<Vec<SchemaVersionResponse>>>;
// Provided method
fn into_rpc(self) -> RpcModule<Self>
where BlockHash: Send + Sync + 'static + DeserializeOwned { ... }
}
Expand description
Server trait implementation for the SchemasApi
RPC API.
Required Methods§
Sourcefn get_by_schema_id(
&self,
schema_id: SchemaId,
) -> RpcResult<Option<SchemaResponse>>
fn get_by_schema_id( &self, schema_id: SchemaId, ) -> RpcResult<Option<SchemaResponse>>
retrieving schema by schema id
Sourcefn check_schema_validity(
&self,
model: Vec<u8>,
at: Option<BlockHash>,
) -> RpcResult<bool>
fn check_schema_validity( &self, model: Vec<u8>, at: Option<BlockHash>, ) -> RpcResult<bool>
validates a schema model and returns true
if the model is correct.
Sourcefn get_versions(
&self,
schema_name: String,
) -> RpcResult<Option<Vec<SchemaVersionResponse>>>
fn get_versions( &self, schema_name: String, ) -> RpcResult<Option<Vec<SchemaVersionResponse>>>
returns an array of schema versions
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.