Struct near_store::TrieUpdate [−][src]
Provides a way to access Storage and record changes with future commit.
Fields
trie: Rc<Trie>
Implementations
impl TrieUpdate
[src]
pub fn new(trie: Rc<Trie>, root: CryptoHash) -> Self
[src]
pub fn trie(&self) -> &Trie
[src]
pub fn get(&self, key: &TrieKey) -> Result<Option<Vec<u8>>, StorageError>
[src]
pub fn get_ref(
&self,
key: &TrieKey
) -> Result<Option<TrieUpdateValuePtr<'_>>, StorageError>
[src]
&self,
key: &TrieKey
) -> Result<Option<TrieUpdateValuePtr<'_>>, StorageError>
pub fn set(&mut self, trie_key: TrieKey, value: Vec<u8>)
[src]
pub fn remove(&mut self, trie_key: TrieKey)
[src]
pub fn commit(&mut self, event: StateChangeCause)
[src]
pub fn rollback(&mut self)
[src]
pub fn finalize(
self
) -> Result<(TrieChanges, Vec<RawStateChangesWithTrieKey>), StorageError>
[src]
self
) -> Result<(TrieChanges, Vec<RawStateChangesWithTrieKey>), StorageError>
pub fn finalize_genesis(self) -> Result<TrieChanges, StorageError>
[src]
pub fn iter(
&self,
key_prefix: &[u8]
) -> Result<TrieUpdateIterator<'_>, StorageError>
[src]
&self,
key_prefix: &[u8]
) -> Result<TrieUpdateIterator<'_>, StorageError>
Returns Error if the underlying storage fails
pub fn range(
&self,
prefix: &[u8],
start: &[u8],
end: &[u8]
) -> Result<TrieUpdateIterator<'_>, StorageError>
[src]
&self,
prefix: &[u8],
start: &[u8],
end: &[u8]
) -> Result<TrieUpdateIterator<'_>, StorageError>
pub fn get_root(&self) -> CryptoHash
[src]
Auto Trait Implementations
impl !RefUnwindSafe for TrieUpdate
impl !Send for TrieUpdate
impl !Sync for TrieUpdate
impl Unpin for TrieUpdate
impl !UnwindSafe for TrieUpdate
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,