Trait concordium_std::HasStateEntry
source · pub trait HasStateEntry{
type StateEntryData;
type StateEntryKey;
type Error: Default;
// Required methods
fn move_to_start(&mut self);
fn size(&self) -> Result<u32, Self::Error>;
fn truncate(&mut self, new_size: u32) -> Result<(), Self::Error>;
fn get_key(&self) -> &[u8] ⓘ;
fn resize(&mut self, new_size: u32) -> Result<(), Self::Error>;
// Provided method
fn reserve(&mut self, len: u32) -> Result<(), Self::Error> { ... }
}
Expand description
A type that can serve as the contract state entry type.
§Deprecation notice
This trait is deprecated along with
crate::test_infrastructure
.
Use StateEntry
instead unless you intend to
use the deprecated test infrastructure.
See the crate documentation for more details.
Required Associated Types§
Required Methods§
sourcefn move_to_start(&mut self)
fn move_to_start(&mut self)
Set the cursor to the beginning. Equivalent to
.seek(SeekFrom::Start(0))
but can be implemented more efficiently.
sourcefn size(&self) -> Result<u32, Self::Error>
fn size(&self) -> Result<u32, Self::Error>
Get the current size of the entry. Returns an error if the entry does not exist.
Provided Methods§
Object Safety§
This trait is not object safe.