pub struct ExternCallResponse { /* private fields */ }
Expand description

A type representing the return value of contract invocation. A contract invocation may return a value. It is returned in the following cases

  • an entrypoint of a V1 contract was invoked and the invocation succeeded
  • an entrypoint of a V1 contract was invoked and the invocation failed due to a CallContractError::LogicReject

In all other cases there is no response.

This type is designed to be used via its Read and HasCallResponse traits.

Typically referred to via the alias CallResponse.

Trait Implementations§

source§

impl Debug for ExternCallResponse

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl HasCallResponse for ExternCallResponse

source§

fn size(&self) -> u32

Get the size of the call response to the contract invocation.
source§

impl Read for ExternCallResponse

The read implementation uses host functions to read chunks of return value on demand.

source§

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

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).
source§

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

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.
source§

fn read_u64(&mut self) -> Result<u64, ParseError>

Read a u64 in little-endian format.
source§

fn read_u32(&mut self) -> Result<u32, ParseError>

Read a u32 in little-endian format.
source§

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

Read a u16 in little-endian format.
source§

fn read_u8(&mut self) -> Result<u8, ParseError>

Read a u8.
source§

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

Read a i64 in little-endian format.
source§

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

Read a i32 in little-endian format.
source§

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

Read a i16 in little-endian format.
source§

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

Read a i32 in little-endian format.
source§

fn read_array<const N: usize>(&mut self) -> Result<[u8; N], ParseError>

Load an array of the given size.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn get(&mut self) -> Result<T, ParseError>

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.