[][src]Struct eosio::DataStream

pub struct DataStream { /* fields omitted */ }

A stream of bytes

Methods

impl DataStream[src]

pub fn read<T: Read>(&mut self) -> Result<T, ReadError>[src]

Read something from the stream

Errors

Will return Err if there was a problem reading the data.

pub fn write<T: Write>(&mut self, thing: T) -> Result<(), WriteError>[src]

Write something to the stream

Errors

Will return Err if there was a problem writing the data.

#[must_use] pub fn as_bytes(&self) -> &[u8][src]

Gets the remaining number of bytes

#[must_use] pub fn as_remaining_bytes(&self) -> Option<&[u8]>[src]

Gets remaining bytes as slice

pub fn reset(&mut self)[src]

Resets the data stream position

#[must_use] pub const fn position(&self) -> usize[src]

Get the current position

#[must_use] pub fn remaining(&self) -> usize[src]

Gets the remaining number of bytes

Trait Implementations

impl AsRef<[u8]> for DataStream[src]

impl Deref for DataStream[src]

type Target = [u8]

The resulting type after dereferencing.

impl<'_> From<&'_ [u8]> for DataStream[src]

impl From<Vec<u8>> for DataStream[src]

Auto Trait Implementations

impl Send for DataStream

impl Sync for DataStream

impl Unpin for DataStream

Blanket Implementations

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

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

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

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

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

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.

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.