[−][src]Trait exonum::runtime::SnapshotExt
Extension trait for Snapshot
allowing to access blockchain data in a more structured way.
Required methods
fn for_core(&self) -> CoreSchema<&dyn Snapshot>
Returns core schema.
fn for_dispatcher(&self) -> DispatcherSchema<&dyn Snapshot>
Returns dispatcher schema.
fn for_service<'q>(
&self,
id: impl Into<InstanceQuery<'q>>
) -> Option<Prefixed<&dyn Snapshot>>
&self,
id: impl Into<InstanceQuery<'q>>
) -> Option<Prefixed<&dyn Snapshot>>
Returns a mount point for a service. If the service does not exist, returns None
.
Safety
This method does not check the service type; the caller is responsible
for constructing a schema of a correct type around the returned access. Constructing
an incorrect schema can lead to a panic or unexpected behavior. Use service_schema
as a safer alternative, which performs all necessary checks.
fn service_schema<'s, 'q, S, I>(
&'s self,
service_id: I
) -> Result<S, ArtifactReqError> where
S: RequireArtifact + FromAccess<Prefixed<&'s dyn Snapshot>>,
I: Into<InstanceQuery<'q>>,
&'s self,
service_id: I
) -> Result<S, ArtifactReqError> where
S: RequireArtifact + FromAccess<Prefixed<&'s dyn Snapshot>>,
I: Into<InstanceQuery<'q>>,
Retrieves schema for a service.
Errors
Returns an error in the following situations (see ArtifactReqError
for more details):
- Service with the given ID does not exist
- Service has an unexpected artifact name
- Service has an incompatible artifact version
Implementations on Foreign Types
impl SnapshotExt for dyn Snapshot
[src]
fn for_core(&self) -> CoreSchema<&dyn Snapshot>
[src]
fn for_dispatcher(&self) -> DispatcherSchema<&dyn Snapshot>
[src]
fn for_service<'q>(
&self,
id: impl Into<InstanceQuery<'q>>
) -> Option<Prefixed<&dyn Snapshot>>
[src]
&self,
id: impl Into<InstanceQuery<'q>>
) -> Option<Prefixed<&dyn Snapshot>>
fn proof_for_index(&self, index_name: &str) -> Option<IndexProof>
[src]
fn service_schema<'s, 'q, S, I>(
&'s self,
service_id: I
) -> Result<S, ArtifactReqError> where
S: RequireArtifact + FromAccess<Prefixed<&'s dyn Snapshot>>,
I: Into<InstanceQuery<'q>>,
[src]
&'s self,
service_id: I
) -> Result<S, ArtifactReqError> where
S: RequireArtifact + FromAccess<Prefixed<&'s dyn Snapshot>>,
I: Into<InstanceQuery<'q>>,