Struct concordium_std::ParseError [−][src]
pub struct ParseError {}
Expand description
Zero-sized type to represent an error when reading bytes and deserializing.
When using custom error types in your smart contract, it is convenient to
implement the trait From<ParseError>
for you custom error type, to allow
using the ?
operator when deserializing bytes, such as the contract state
or parameters.
ⓘ
enum MyCustomReceiveError { Parsing } impl From<ParseError> for MyCustomReceiveError { fn from(_: ParseError) -> Self { MyCustomReceiveError::ParseParams } } #[receive(contract = "mycontract", name="some_receive_name")] fn contract_receive<R: HasReceiveContext, L: HasLogger, A: HasActions>( ctx: &R, receive_amount: Amount, logger: &mut L, state: &mut State, ) -> Result<A, MyCustomReceiveError> { ... let msg: MyParameterType = ctx.parameter_cursor().get()?; ... }
Trait Implementations
impl Debug for ParseError
[src]
impl Debug for ParseError
[src]impl Default for ParseError
[src]
impl Default for ParseError
[src]pub fn default() -> ParseError
[src]
pub fn default() -> ParseError
[src]Returns the “default value” for a type. Read more
impl From<ParseError> for Reject
[src]
impl From<ParseError> for Reject
[src]fn from(_: ParseError) -> Self
[src]
fn from(_: ParseError) -> Self
[src]Performs the conversion.
impl PartialEq<ParseError> for ParseError
[src]
impl PartialEq<ParseError> for ParseError
[src]