Struct linera_execution::ExecutionStateView
source · pub struct ExecutionStateView<C> {
pub system: SystemExecutionStateView<C>,
pub users: HashedReentrantCollectionView<C, UserApplicationId, KeyValueStoreView<C>>,
}Expand description
A view accessing the execution state of a chain.
Fields§
§system: SystemExecutionStateView<C>System application.
users: HashedReentrantCollectionView<C, UserApplicationId, KeyValueStoreView<C>>User applications.
Implementations§
source§impl<C> ExecutionStateView<C>
impl<C> ExecutionStateView<C>
pub async fn execute_operation( &mut self, context: OperationContext, operation: Operation, resource_controller: &mut ResourceController<Option<Owner>> ) -> Result<Vec<ExecutionOutcome>, ExecutionError>
pub async fn execute_message( &mut self, context: MessageContext, message: Message, grant: Option<&mut Amount>, resource_controller: &mut ResourceController<Option<Owner>> ) -> Result<Vec<ExecutionOutcome>, ExecutionError>
pub async fn bounce_message( &self, context: MessageContext, grant: Amount, refund_grant_to: Option<Account>, message: Message ) -> Result<Vec<ExecutionOutcome>, ExecutionError>
pub async fn send_refund( &self, context: MessageContext, amount: Amount, account: Account ) -> Result<ExecutionOutcome, ExecutionError>
pub async fn query_application( &mut self, context: QueryContext, query: Query ) -> Result<Response, ExecutionError>
pub async fn list_applications( &self ) -> Result<Vec<(UserApplicationId, UserApplicationDescription)>, ExecutionError>
Trait Implementations§
source§impl<C: Send + Sync + Context> ContainerType for ExecutionStateView<C>
impl<C: Send + Sync + Context> ContainerType for ExecutionStateView<C>
source§async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
Resolves a field value and outputs it as a json value
async_graphql::Value. Read moresource§async fn find_entity(
&self,
ctx: &Context<'_>,
params: &Value
) -> ServerResult<Option<Value>>
async fn find_entity( &self, ctx: &Context<'_>, params: &Value ) -> ServerResult<Option<Value>>
Find the GraphQL entity with the given name from the parameter. Read more
source§fn collect_all_fields<'a>(
&'a self,
ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>,
fields: &mut Fields<'a>
) -> Result<(), ServerError>
fn collect_all_fields<'a>( &'a self, ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>, fields: &mut Fields<'a> ) -> Result<(), ServerError>
Collect all the fields of the container that are queried in the
selection set. Read more
source§impl<C> CryptoHashView<C> for ExecutionStateView<C>
impl<C> CryptoHashView<C> for ExecutionStateView<C>
source§fn crypto_hash<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<CryptoHash, ViewError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn crypto_hash<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<CryptoHash, ViewError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Computing the hash and attributing the type to it.
source§impl<C: Debug> Debug for ExecutionStateView<C>
impl<C: Debug> Debug for ExecutionStateView<C>
source§impl<C> HashableView<C> for ExecutionStateView<C>
impl<C> HashableView<C> for ExecutionStateView<C>
§type Hasher = CoreWrapper<Sha3_256Core>
type Hasher = CoreWrapper<Sha3_256Core>
How to compute hashes.
source§impl<C: Send + Sync + Context> OutputType for ExecutionStateView<C>
impl<C: Send + Sync + Context> OutputType for ExecutionStateView<C>
source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
source§async fn resolve(
&self,
ctx: &ContextSelectionSet<'_>,
_field: &Positioned<Field>
) -> ServerResult<Value>
async fn resolve( &self, ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field> ) -> ServerResult<Value>
Resolve an output value to
async_graphql::Value.source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
source§impl<C> View<C> for ExecutionStateView<C>
impl<C> View<C> for ExecutionStateView<C>
source§fn load<'async_trait>(
context: C
) -> Pin<Box<dyn Future<Output = Result<Self, ViewError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn load<'async_trait>(
context: C
) -> Pin<Box<dyn Future<Output = Result<Self, ViewError>> + Send + 'async_trait>>where
Self: 'async_trait,
Creates a view or a subview.
source§fn rollback(&mut self)
fn rollback(&mut self)
Discards all pending changes. After that
flush should have no effect to storage.source§fn flush(&mut self, batch: &mut Batch) -> Result<bool, ViewError>
fn flush(&mut self, batch: &mut Batch) -> Result<bool, ViewError>
Persists changes to storage. This leaves the view still usable and is essentially neutral to the
program running. Crash-resistant storage implementations are expected to accumulate the desired
changes in the
batch variable first. If the view is dropped without calling flush, staged
changes are simply lost.
The returned boolean indicates whether the operation removes the view or not.impl<C: Send + Sync + Context> ObjectType for ExecutionStateView<C>
Auto Trait Implementations§
impl<C> !Freeze for ExecutionStateView<C>
impl<C> !RefUnwindSafe for ExecutionStateView<C>
impl<C> Send for ExecutionStateView<C>
impl<C> Sync for ExecutionStateView<C>
impl<C> Unpin for ExecutionStateView<C>where
C: Unpin,
impl<C> !UnwindSafe for ExecutionStateView<C>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more