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§

source

fn get_by_schema_id( &self, schema_id: SchemaId ) -> RpcResult<Option<SchemaResponse>>

retrieving schema by schema id

source

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.

source

fn get_versions( &self, schema_name: String ) -> RpcResult<Option<Vec<SchemaVersionResponse>>>

returns an array of schema versions

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>
where BlockHash: Send + Sync + 'static + DeserializeOwned,

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<C, Block> SchemasApiServer<<Block as Block>::Hash> for SchemasHandler<C, Block>
where Block: BlockT, C: 'static + ProvideRuntimeApi<Block> + HeaderBackend<Block>, C::Api: SchemasRuntimeApi<Block>,