Struct concordium_std::ContractState[][src]

pub struct ContractState { /* fields omitted */ }
Expand description

A type representing the constract state bytes.

Trait Implementations

impl Default for ContractState[src]

fn default() -> ContractState[src]

Returns the “default value” for a type. Read more

impl HasContractState<()> for ContractState[src]

type ContractStateData = ()

fn open(_: Self::ContractStateData) -> Self[src]

Open the contract state. Only one instance can be opened at the same time. Read more

fn reserve(&mut self, len: u32) -> bool[src]

Make sure that the memory size is at least that many bytes in size. Returns true iff this was successful. The new bytes are initialized as 0. Read more

fn size(&self) -> u32[src]

Get the current size of contract state.

fn truncate(&mut self, new_size: u32)[src]

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

impl Read for ContractState[src]

fn read_u64(&mut self) -> ParseResult<u64>[src]

Read a u32 in little-endian format. This is optimized to not initialize a dummy value before calling an external function.

fn read_u32(&mut self) -> ParseResult<u32>[src]

Read a u32 in little-endian format. This is optimized to not initialize a dummy value before calling an external function.

fn read_u8(&mut self) -> ParseResult<u8>[src]

Read a u8 in little-endian format. This is optimized to not initialize a dummy value before calling an external function.

fn read(&mut self, buf: &mut [u8]) -> ParseResult<usize>[src]

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

fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), ParseError>[src]

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

fn read_u16(&mut self) -> Result<u16, ParseError>[src]

Read a u16 in little-endian format.

fn read_i64(&mut self) -> Result<i64, ParseError>[src]

Read a i64 in little-endian format.

fn read_i32(&mut self) -> Result<i32, ParseError>[src]

Read a i32 in little-endian format.

fn read_i16(&mut self) -> Result<i16, ParseError>[src]

Read a i16 in little-endian format.

fn read_i8(&mut self) -> Result<i8, ParseError>[src]

Read a i32 in little-endian format.

impl Seek for ContractState[src]

type Err = ()

fn seek(&mut self, pos: SeekFrom) -> Result<u64, Self::Err>[src]

Seek to the new position. If successful, return the new position from the beginning of the stream. Read more

impl Write for ContractState[src]

type Err = ()

fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Err>[src]

Try to write the given buffer into the output stream. If writes are successful returns the number of bytes written. Read more

fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Err>[src]

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

fn write_u8(&mut self, x: u8) -> Result<(), Self::Err>[src]

Write a single byte to the output.

fn write_u16(&mut self, x: u16) -> Result<(), Self::Err>[src]

Write a u16 in little endian.

fn write_u32(&mut self, x: u32) -> Result<(), Self::Err>[src]

Write a u32 in little endian.

fn write_u64(&mut self, x: u64) -> Result<(), Self::Err>[src]

Write a u64 in little endian.

fn write_i8(&mut self, x: i8) -> Result<(), Self::Err>[src]

Write a i8 to the output.

fn write_i16(&mut self, x: i16) -> Result<(), Self::Err>[src]

Write a i16 in little endian.

fn write_i32(&mut self, x: i32) -> Result<(), Self::Err>[src]

Write a i32 in little endian.

fn write_i64(&mut self, x: i64) -> Result<(), Self::Err>[src]

Write a i64 in little endian.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<R, T> Get<T> for R where
    T: Deserial,
    R: Read
[src]

pub fn get(&mut self) -> Result<T, ParseError>[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.