pallet_schemas_rpc

Trait SchemasApiServer

Source
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.

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.

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>,