Struct concordium_std::test_infrastructure::ContractStateTest [−][src]
pub struct ContractStateTest<T> {
pub cursor: Cursor<T>,
}
Expand description
Contract state for testing, mimicking the operations the scheduler allows, including the limit on the size of the maximum size of the contract state.
Fields
cursor: Cursor<T>
Trait Implementations
impl<T: AsMut<Vec<u8>> + AsMut<[u8]> + AsRef<[u8]>> HasContractState<ContractStateError> for ContractStateTest<T>
impl<T: AsMut<Vec<u8>> + AsMut<[u8]> + AsRef<[u8]>> HasContractState<ContractStateError> for ContractStateTest<T>
type ContractStateData = T
Open the contract state. Only one instance can be opened at the same time. Read more
Truncate the state to the given size. If the given size is more than the current state size this operation does nothing. The new position is at most at the end of the stream. Read more
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). Read more
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. Read more
Read a u64
in little-endian format.
Read a u32
in little-endian format.
Read a u16
in little-endian format.
Read a u8
.
Read a i64
in little-endian format.
Read a i32
in little-endian format.
Read a i16
in little-endian format.
Read a i32
in little-endian format.
type Err = ContractStateError
Try to write the given buffer into the output stream. If writes are successful returns the number of bytes written. Read more
Attempt to write the entirety of the buffer to the output by repeatedly
calling write
until either no more output can written, or writing
fails. Read more