[−][src]Struct eosio::DataStream
A stream of bytes
Methods
impl DataStream
[src]
pub fn read<T: Read>(&mut self) -> Result<T, ReadError>
[src]
pub fn write<T: Write>(&mut self, thing: T) -> Result<(), WriteError>
[src]
#[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.
#[must_use]
fn deref(&self) -> &Self::Target
[src]
impl<'_> From<&'_ [u8]> for DataStream
[src]
impl From<Vec<u8>> for DataStream
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,