Struct sp_state_machine::ReadOnlyExternalities [−][src]
Simple read-only externalities for any backend.
To be used in test for state inspection. Will panic if something writes to the storage.
Implementations
impl<'a, H: Hasher, B: 'a + Backend<H>> ReadOnlyExternalities<'a, H, B>
[src]
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.
Trait Implementations
impl<'a, H: Debug + Hasher, B: Debug + 'a + Backend<H>> Debug for ReadOnlyExternalities<'a, H, B>
[src]
impl<'a, H: Hasher, B: 'a + Backend<H>> ExtensionStore for ReadOnlyExternalities<'a, H, B>
[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<'a, H: Hasher, B: 'a + Backend<H>> Externalities for ReadOnlyExternalities<'a, H, B>
[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]
&mut self,
_key: StorageKey,
_maybe_value: Option<StorageValue>
)
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,
_limit: Option<u32>
) -> bool
[src]
&mut self,
_child_info: &ChildInfo,
_limit: Option<u32>
) -> bool
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 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<'a, H: Hasher, B: 'a + Backend<H>> From<&'a B> for ReadOnlyExternalities<'a, H, B>
[src]
Auto Trait Implementations
impl<'a, H, B> RefUnwindSafe for ReadOnlyExternalities<'a, H, B> where
B: RefUnwindSafe,
H: RefUnwindSafe,
[src]
B: RefUnwindSafe,
H: RefUnwindSafe,
impl<'a, H, B> Send for ReadOnlyExternalities<'a, H, B> where
B: Sync,
[src]
B: Sync,
impl<'a, H, B> Sync for ReadOnlyExternalities<'a, H, B> where
B: Sync,
[src]
B: Sync,
impl<'a, H, B> Unpin for ReadOnlyExternalities<'a, H, B> where
H: Unpin,
[src]
H: Unpin,
impl<'a, H, B> UnwindSafe for ReadOnlyExternalities<'a, H, B> where
B: RefUnwindSafe,
H: UnwindSafe,
[src]
B: RefUnwindSafe,
H: 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,
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,
T: Debug,
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Same<T> for T
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>,
V: MultiLane<T>,