pub struct ExecutionExtensions<Block: BlockT> { /* private fields */ }
Expand description

A producer of execution extensions for offchain calls.

This crate aggregates extensions available for the offchain calls and is responsible for producing a correct Extensions object. for each call, based on required Capabilities.

Implementations§

Create new ExecutionExtensions given a keystore and ExecutionStrategies.

Get a reference to the execution strategies.

Set the new extensions_factory

Register transaction pool extension.

Based on the execution context and capabilities it produces the extensions object to support desired set of APIs.

Examples found in repository?
src/execution_extensions.rs (line 296)
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
	pub fn manager_and_extensions<E: std::fmt::Debug>(
		&self,
		block_hash: Block::Hash,
		block_number: NumberFor<Block>,
		context: ExecutionContext,
	) -> (ExecutionManager<DefaultHandler<E>>, Extensions) {
		let manager = match context {
			ExecutionContext::BlockConstruction => self.strategies.block_construction.get_manager(),
			ExecutionContext::Syncing => self.strategies.syncing.get_manager(),
			ExecutionContext::Importing => self.strategies.importing.get_manager(),
			ExecutionContext::OffchainCall(Some((_, capabilities))) if capabilities.is_all() =>
				self.strategies.offchain_worker.get_manager(),
			ExecutionContext::OffchainCall(_) => self.strategies.other.get_manager(),
		};

		(manager, self.extensions(block_hash, block_number, context))
	}

Create ExecutionManager and Extensions for given offchain call.

Based on the execution context and capabilities it produces the right manager and extensions object to support desired set of APIs.

Trait Implementations§

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert from a value of T into an equivalent instance of Option<Self>. Read more
Consume self to return Some equivalent value of Option<T>. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
Convert from a value of T into an equivalent instance of Self. Read more
Consume self to return an equivalent value of T. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The counterpart to unchecked_from.
Consume self to return an equivalent value of T.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more