Enum concordium_std::EntryRaw
source · [−]pub enum EntryRaw<StateApi: HasStateApi> {
Vacant(VacantEntryRaw<StateApi>),
Occupied(OccupiedEntryRaw<StateApi>),
}
Expand description
A view into a single entry in a HasStateApi
type,
which may either be vacant or occupied.
This enum
is constructed from the entry
method on a HasStateApi
type.
Variants
Vacant(VacantEntryRaw<StateApi>)
Occupied(OccupiedEntryRaw<StateApi>)
Implementations
sourceimpl<StateApi: HasStateApi> EntryRaw<StateApi>
impl<StateApi: HasStateApi> EntryRaw<StateApi>
sourcepub fn or_insert_raw(
self,
default: &[u8]
) -> Result<StateApi::EntryType, StateError>
pub fn or_insert_raw(
self,
default: &[u8]
) -> Result<StateApi::EntryType, StateError>
Ensures a value is in the entry by inserting the default if empty, and
returns the HasStateEntry
type for the entry.
sourcepub fn or_insert<V: Serial>(self, default: &V) -> StateApi::EntryType
pub fn or_insert<V: Serial>(self, default: &V) -> StateApi::EntryType
Ensures a value is in the entry by inserting the default if empty, and
returns the HasStateEntry
type. This differs from
or_insert_raw
in that it automatically
serializes the provided value. or_insert
should
be preferred for values that can be directly converted to byte
arrays, e.g., any value that implements AsRef<[u8]>
.
Auto Trait Implementations
impl<StateApi> RefUnwindSafe for EntryRaw<StateApi> where
StateApi: RefUnwindSafe,
<StateApi as HasStateApi>::EntryType: RefUnwindSafe,
impl<StateApi> Send for EntryRaw<StateApi> where
StateApi: Send,
<StateApi as HasStateApi>::EntryType: Send,
impl<StateApi> Sync for EntryRaw<StateApi> where
StateApi: Sync,
<StateApi as HasStateApi>::EntryType: Sync,
impl<StateApi> Unpin for EntryRaw<StateApi> where
StateApi: Unpin,
<StateApi as HasStateApi>::EntryType: Unpin,
impl<StateApi> UnwindSafe for EntryRaw<StateApi> where
StateApi: UnwindSafe,
<StateApi as HasStateApi>::EntryType: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more