Struct sp_state_machine::BasicExternalities [−][src]
Simple Map-based Externalities impl.
Implementations
impl BasicExternalities
[src]
pub fn new(inner: Storage) -> Self
[src]
Create a new instance of BasicExternalities
pub fn new_empty() -> Self
[src]
New basic externalities with empty storage.
pub fn insert(&mut self, k: StorageKey, v: StorageValue) -> Option<StorageValue>
[src]
Insert key/value
pub fn into_storages(self) -> Storage
[src]
Consume self and returns inner storages
pub fn execute_with_storage<R>(
storage: &mut Storage,
f: impl FnOnce() -> R
) -> R
[src]
storage: &mut Storage,
f: impl FnOnce() -> R
) -> R
Execute the given closure f
with the externalities set and initialized with storage
.
Returns the result of the closure and updates storage
with all changes.
pub fn execute_with<R>(&mut self, f: impl FnOnce() -> R) -> R
[src]
Execute the given closure while self
is set as externalities.
Returns the result of the given closure.
pub fn extensions(&mut self) -> &mut Extensions
[src]
List of active extensions.
pub fn register_extension(&mut self, ext: impl Extension)
[src]
Register an extension.
Trait Implementations
impl Debug for BasicExternalities
[src]
impl Default for BasicExternalities
[src]
impl ExtensionStore for BasicExternalities
[src]
fn extension_by_type_id(&mut self, type_id: TypeId) -> Option<&mut dyn Any>
[src]
fn register_extension_with_type_id(
&mut self,
type_id: TypeId,
extension: Box<dyn Extension>
) -> Result<(), Error>
[src]
&mut self,
type_id: TypeId,
extension: Box<dyn Extension>
) -> Result<(), Error>
fn deregister_extension_by_type_id(
&mut self,
type_id: TypeId
) -> Result<(), Error>
[src]
&mut self,
type_id: TypeId
) -> Result<(), Error>
impl Externalities for BasicExternalities
[src]
fn set_offchain_storage(&mut self, _key: &[u8], _value: Option<&[u8]>)
[src]
fn storage(&self, key: &[u8]) -> Option<StorageValue>
[src]
fn storage_hash(&self, key: &[u8]) -> Option<Vec<u8>>
[src]
fn child_storage(
&self,
child_info: &ChildInfo,
key: &[u8]
) -> Option<StorageValue>
[src]
&self,
child_info: &ChildInfo,
key: &[u8]
) -> Option<StorageValue>
fn child_storage_hash(
&self,
child_info: &ChildInfo,
key: &[u8]
) -> Option<Vec<u8>>
[src]
&self,
child_info: &ChildInfo,
key: &[u8]
) -> Option<Vec<u8>>
fn next_storage_key(&self, key: &[u8]) -> Option<StorageKey>
[src]
fn next_child_storage_key(
&self,
child_info: &ChildInfo,
key: &[u8]
) -> Option<StorageKey>
[src]
&self,
child_info: &ChildInfo,
key: &[u8]
) -> Option<StorageKey>
fn place_storage(&mut self, key: StorageKey, maybe_value: Option<StorageValue>)
[src]
fn place_child_storage(
&mut self,
child_info: &ChildInfo,
key: StorageKey,
value: Option<StorageValue>
)
[src]
&mut self,
child_info: &ChildInfo,
key: StorageKey,
value: Option<StorageValue>
)
fn kill_child_storage(&mut self, child_info: &ChildInfo)
[src]
fn clear_prefix(&mut self, prefix: &[u8])
[src]
fn clear_child_prefix(&mut self, child_info: &ChildInfo, prefix: &[u8])
[src]
fn storage_append(&mut self, key: Vec<u8>, value: Vec<u8>)
[src]
fn chain_id(&self) -> u64
[src]
fn storage_root(&mut self) -> Vec<u8>
[src]
fn child_storage_root(&mut self, child_info: &ChildInfo) -> Vec<u8>
[src]
fn storage_changes_root(
&mut self,
_parent: &[u8]
) -> Result<Option<Vec<u8>>, ()>
[src]
&mut self,
_parent: &[u8]
) -> Result<Option<Vec<u8>>, ()>
fn storage_start_transaction(&mut self)
[src]
fn storage_rollback_transaction(&mut self) -> Result<(), ()>
[src]
fn storage_commit_transaction(&mut self) -> Result<(), ()>
[src]
fn wipe(&mut self)
[src]
fn commit(&mut self)
[src]
fn read_write_count(&self) -> (u32, u32, u32, u32)
[src]
fn reset_read_write_count(&mut self)
[src]
fn get_whitelist(&self) -> Vec<TrackedStorageKey>
[src]
fn set_whitelist(&mut self, _: Vec<TrackedStorageKey>)
[src]
pub fn set_storage(&mut self, key: Vec<u8, Global>, value: Vec<u8, Global>)
[src]
pub fn set_child_storage(
&mut self,
child_info: &ChildInfo,
key: Vec<u8, Global>,
value: Vec<u8, Global>
)
[src]
&mut self,
child_info: &ChildInfo,
key: Vec<u8, Global>,
value: Vec<u8, Global>
)
pub fn clear_storage(&mut self, key: &[u8])
[src]
pub fn clear_child_storage(&mut self, child_info: &ChildInfo, key: &[u8])
[src]
pub fn exists_storage(&self, key: &[u8]) -> bool
[src]
pub fn exists_child_storage(&self, child_info: &ChildInfo, key: &[u8]) -> bool
[src]
impl From<BTreeMap<Vec<u8, Global>, Vec<u8, Global>>> for BasicExternalities
[src]
fn from(hashmap: BTreeMap<StorageKey, StorageValue>) -> Self
[src]
impl FromIterator<(Vec<u8, Global>, Vec<u8, Global>)> for BasicExternalities
[src]
fn from_iter<I: IntoIterator<Item = (StorageKey, StorageValue)>>(
iter: I
) -> Self
[src]
iter: I
) -> Self
impl PartialEq<BasicExternalities> for BasicExternalities
[src]
Auto Trait Implementations
impl !RefUnwindSafe for BasicExternalities
impl Send for BasicExternalities
impl !Sync for BasicExternalities
impl Unpin for BasicExternalities
impl !UnwindSafe for BasicExternalities
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Outer> IsWrappedBy<Outer> for T where
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
[src]
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
pub fn from_ref(outer: &Outer) -> &T
[src]
Get a reference to the inner from the outer.
pub fn from_mut(outer: &mut Outer) -> &mut T
[src]
Get a mutable reference to the inner from the outer.
impl<T> MaybeDebug for T where
T: Debug,
[src]
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,
[src]
T: Debug,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
[src]
T: UncheckedFrom<S>,
pub fn unchecked_into(self) -> T
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,