Struct concordium_std::StateEntry
source · pub struct StateEntry { /* private fields */ }
Expand description
Represents the data in a node in the state trie.
Trait Implementations§
source§impl HasStateEntry for StateEntry
impl HasStateEntry for StateEntry
type Error = ()
type StateEntryData = ()
type StateEntryKey = ()
source§fn 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.source§fn 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.
source§fn truncate(&mut self, new_size: u32) -> Result<(), Self::Error>
fn truncate(&mut self, new_size: u32) -> Result<(), Self::Error>
Truncate the entry to the given size. If the given size is more than the
current size this operation does nothing. The new position is at
most at the end of the stream.
Returns an error if the entry does not exist.
source§impl Read for StateEntry
impl Read for StateEntry
source§fn read_u64(&mut self) -> ParseResult<u64>
fn read_u64(&mut self) -> ParseResult<u64>
Read a u64
in little-endian format. This is optimized to not
initialize a dummy value before calling an external function.
source§fn read_u32(&mut self) -> ParseResult<u32>
fn read_u32(&mut self) -> ParseResult<u32>
Read a u32
in little-endian format. This is optimized to not
initialize a dummy value before calling an external function.
source§fn read_u8(&mut self) -> ParseResult<u8>
fn read_u8(&mut self) -> ParseResult<u8>
Read a u8
in little-endian format. This is optimized to not
initialize a dummy value before calling an external function.
source§fn read(&mut self, buf: &mut [u8]) -> ParseResult<usize>
fn read(&mut self, buf: &mut [u8]) -> ParseResult<usize>
Read a number of bytes into the provided buffer. The returned value is
Ok(n)
if a read was successful, and n
bytes were read (n
could be
0).source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), ParseError>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), ParseError>
Read exactly the required number of bytes. If not enough bytes could be
read the function returns
Err(_)
, and the contents of the given buffer
is unspecified.source§fn read_array<const N: usize>(&mut self) -> Result<[u8; N], ParseError>
fn read_array<const N: usize>(&mut self) -> Result<[u8; N], ParseError>
Load an array of the given size.
source§impl Seek for StateEntry
impl Seek for StateEntry
source§impl Write for StateEntry
impl Write for StateEntry
type Err = ()
source§fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Err>
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Err>
Try to write the given buffer into the output stream. If writes are
successful returns the number of bytes written.
Auto Trait Implementations§
impl Freeze for StateEntry
impl RefUnwindSafe for StateEntry
impl Send for StateEntry
impl Sync for StateEntry
impl Unpin for StateEntry
impl UnwindSafe for StateEntry
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