Trait concordium_std::Seek

source ·
pub trait Seek {
    type Err;

    // Required methods
    fn seek(&mut self, pos: SeekFrom) -> Result<u32, Self::Err>;
    fn cursor_position(&self) -> u32;
}
Expand description

The Seek trait provides a cursor which can be moved within a stream of bytes. This is essentially a copy of std::io::Seek, but avoiding its dependency on std::io::Error, and the associated code size increase. Additionally, the positions are expressed in terms of 32-bit integers since this is adequate for the sizes of data in smart contracts.

Required Associated Types§

Required Methods§

source

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

Get the cursor position counted from the beginning of the stream.

Implementors§

source§

impl Seek for StateEntry

§

type Err = ()

source§

impl Seek for TestStateEntry

source§

impl<'a> Seek for TestParameterCursor<'a>

§

type Err = ()

source§

impl<T> Seek for Cursor<T>where
T: HasSize,

§

type Err = ()