[−][src]Struct exonum::runtime::BlockchainData
Provides access to blockchain data for the executing service.
Methods
impl<T: RawAccess + AsReadonly> BlockchainData<T>
[src]
pub fn new(access: T, instance_name: impl Into<String>) -> Self
[src]
Creates structured access to blockchain data based on the unstructured access
(e.g., a Snapshot
or a Fork
) and the descriptor of the executing service.
pub fn instance_name(&self) -> &str
[src]
Returns the instance name of the executing service.
pub fn for_core(&self) -> CoreSchema<T::Readonly>
[src]
Returns core schema.
pub fn for_dispatcher(&self) -> DispatcherSchema<T::Readonly>
[src]
Returns dispatcher schema.
pub fn for_service<'q>(
&self,
id: impl Into<InstanceQuery<'q>>
) -> Option<Prefixed<T::Readonly>>
[src]
&self,
id: impl Into<InstanceQuery<'q>>
) -> Option<Prefixed<T::Readonly>>
Returns a mount point for another service. If the service with id
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.
pub fn service_schema<'q, S, I>(
&self,
service_id: I
) -> Result<S, ArtifactReqError> where
S: RequireArtifact + FromAccess<Prefixed<T::Readonly>>,
I: Into<InstanceQuery<'q>>,
[src]
&self,
service_id: I
) -> Result<S, ArtifactReqError> where
S: RequireArtifact + FromAccess<Prefixed<T::Readonly>>,
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
pub fn for_executing_service(&self) -> Prefixed<T>
[src]
Returns a mount point for the data of the executing service instance.
Unlike other data, this one may be writeable provided that this BlockchainData
wraps a Fork
.
impl<'_> BlockchainData<&'_ dyn Snapshot>
[src]
pub fn proof_for_service_index(&self, index_name: &str) -> Option<IndexProof>
[src]
Returns a proof for a Merkelized index with the specified name in the currently executing service.
Return value
If the index does not exist or is not Merkelized, returns None
. Note that this may
occur before the index is accessed the first time, which, depending on the service logic,
may happen indefinitely after the service has been initialized. Thus, unwrap
ping the
returned value may unexpectedly lead to a panic unless the index is initialized early
(e.g., during service initialization).
impl<'a, T> BlockchainData<T> where
T: Into<GenericRawAccess<'a>>,
[src]
T: Into<GenericRawAccess<'a>>,
pub fn erase_access(self) -> BlockchainData<GenericRawAccess<'a>>
[src]
Erases the enclosed access, converting it to the generic form.
Trait Implementations
impl<T: Clone> Clone for BlockchainData<T>
[src]
fn clone(&self) -> BlockchainData<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for BlockchainData<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for BlockchainData<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for BlockchainData<T> where
T: Send,
T: Send,
impl<T> Sync for BlockchainData<T> where
T: Sync,
T: Sync,
impl<T> Unpin for BlockchainData<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for BlockchainData<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,