Enum xrpl_hooks::api::Result[][src]

pub enum Result<T> {
    Ok(T),
    Err(i64),
}
Expand description

Result is a type that represents either success (Ok) or failure (Err). This is simple version of Result type to comply XRPL Hooks Webassembly restrictions

Variants

Ok(T)

Contains the success value

Tuple Fields of Ok

0: T
Err(i64)

Contains the error value

Tuple Fields of Err

0: i64

Implementations

Returns the contained Ok value, consuming the self value.

Rollbacks

Rollbacks if the value is an Err, with a rollback message and error code.

Returns the contained Ok value, consuming the self value.

Because this function may rollback, its use is generally discouraged. Instead, prefer to use pattern matching and handle the Err case explicitly.

Rollbacks

Rollbacks if the value is an Err, with a “error” and error code provided by the Err’s value.

Returns the contained Ok value, consuming the self value, without checking that the value is not an Err.

Safety

Calling this method on an Err is undefined behavior.

Returns true if the result is Ok.

Returns true if the result is Err.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.