pub struct NeoStorage;Expand description
Storage convenience helpers built on top of the syscall layer.
Implementations§
Source§impl NeoStorage
impl NeoStorage
pub fn get_context() -> Result<NeoStorageContext, NeoError>
pub fn get_read_only_context() -> Result<NeoStorageContext, NeoError>
pub fn as_read_only( context: &NeoStorageContext, ) -> Result<NeoStorageContext, NeoError>
Sourcepub fn get(
context: &NeoStorageContext,
key: &NeoByteString,
) -> Result<NeoByteString, NeoError>
pub fn get( context: &NeoStorageContext, key: &NeoByteString, ) -> Result<NeoByteString, NeoError>
Read a stored value.
Ambiguity warning (D8): this returns an empty NeoByteString both
when the key is absent AND when the stored value is genuinely empty, so
the two cases are indistinguishable. For existence-sensitive reads,
prefer NeoVMSyscall::storage_try_get (returns Option) or
RawStorage::get_into (returns RawStorageGet::Missing).
pub fn put( context: &NeoStorageContext, key: &NeoByteString, value: &NeoByteString, ) -> Result<(), NeoError>
pub fn delete( context: &NeoStorageContext, key: &NeoByteString, ) -> Result<(), NeoError>
pub fn find( context: &NeoStorageContext, prefix: &NeoByteString, ) -> Result<NeoIterator<NeoValue>, NeoError>
Auto Trait Implementations§
impl Freeze for NeoStorage
impl RefUnwindSafe for NeoStorage
impl Send for NeoStorage
impl Sync for NeoStorage
impl Unpin for NeoStorage
impl UnsafeUnpin for NeoStorage
impl UnwindSafe for NeoStorage
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