pub struct TestStateEntry { /* private fields */ }
๐Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
Expand description
A state entry used for testing. Implements HasStateEntry
.
Trait Implementationsยง
Sourceยงimpl Debug for TestStateEntry
impl Debug for TestStateEntry
Sourceยงimpl HasStateEntry for TestStateEntry
impl HasStateEntry for TestStateEntry
Sourceยงfn size(&self) -> Result<u32, Self::Error>
fn size(&self) -> Result<u32, Self::Error>
Get the size of the data in the entry. Returns an error if the entry has been deleted with delete_prefix.
Sourceยงfn truncate(&mut self, new_size: u32) -> Result<(), Self::Error>
fn truncate(&mut self, new_size: u32) -> Result<(), Self::Error>
Truncate the entry. Returns an error if the entry has been deleted with delete_prefix.
Sourceยงfn resize(&mut self, new_size: u32) -> Result<(), Self::Error>
fn resize(&mut self, new_size: u32) -> Result<(), Self::Error>
Resize the entry. Returns an error if the entry has been deleted with delete_prefix.
type Error = TestStateError
type StateEntryData = Rc<RefCell<TestStateEntryData>>
type StateEntryKey = Vec<u8>
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ยงimpl Read for TestStateEntry
impl Read for TestStateEntry
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 TestStateEntry
impl Seek for TestStateEntry
type Err = TestStateError
Sourceยงfn seek(&mut self, pos: SeekFrom) -> Result<u32, Self::Err>
fn seek(&mut self, pos: SeekFrom) -> Result<u32, Self::Err>
Seek to the new position. If successful, return the new position from
the beginning of the stream.
Sourceยงfn cursor_position(&self) -> u32
fn cursor_position(&self) -> u32
Get the cursor position counted from the beginning of the stream.
Sourceยงimpl Write for TestStateEntry
impl Write for TestStateEntry
type Err = TestStateError
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 TestStateEntry
impl !RefUnwindSafe for TestStateEntry
impl !Send for TestStateEntry
impl !Sync for TestStateEntry
impl Unpin for TestStateEntry
impl !UnwindSafe for TestStateEntry
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