[−][src]Enum casperlabs_contract_ffi::contract_api::Error
Variants to be passed to runtime::revert()
.
Variants other than Error::User
will represent a u32
in the range (0, u16::MAX]
, while
Error::User
will represent a u32
in the range (u16::MAX, 2 * u16::MAX + 1]
.
Users can specify a C-style enum and implement From
to ease usage of
runtime::revert()
, e.g.
use casperlabs_contract_ffi::contract_api::Error; #[repr(u16)] enum FailureCode { Zero = 0, // 65,536 as an Error::User One, // 65,537 as an Error::User Two // 65,538 as an Error::User } impl From<FailureCode> for Error { fn from(code: FailureCode) -> Self { Error::User(code as u16) } } assert_eq!(Error::User(1), FailureCode::One.into()); assert_eq!(65_536, u32::from(Error::from(FailureCode::Zero))); assert_eq!(65_538, u32::from(Error::from(FailureCode::Two)));
Variants
Optional data was unexpectedly None
.
Specified argument not provided.
Argument not of correct type.
Failed to deserialize a value.
read
returned an error.
The given key returned a None
value.
Failed to find a specified contract.
A call to get_key()
returned a failure.
The Key
variant was not as expected.
The Value
variant was not as expected.
The ContractRef
variant was not as expected.
Invalid purse name given.
Invalid purse retrieved.
Failed to upgrade contract at URef.
Failed to transfer motes.
No access rights.
A given type could be derived from a Value
.
A given type could be derived from a CLValue
.
Early end of stream when deserializing.
Formatting error.
Leftover bytes.
Out of memory error.
Unable to add new associated key because maximum amount of keys is reached.
Unable to add new associated key because given key already exists.
Unable to add/update/remove new associated key due to insufficient permissions.
Unable to update/remove a key that does exist.
Unable to update/remove a key which would violate action threshold constraints.
New threshold should be lower or equal than deployment threshold.
New threshold should be lower or equal than key management threshold.
Unable to set action threshold due to insufficient permissions.
New threshold should be lower or equal than total weight of associated keys.
Returns when contract tries to obtain URef to a system contract that does not exist.
Failed to create a new purse.
An unhandled value, likely representing a bug in the code.
Passing a buffer of a size that is too small to complete an operation
No data available in the host buffer.
Data in the host buffer is full and should be consumed first by read operation
Error specific to Mint contract.
Error specific to Proof of Stake contract.
User-specified value. The internal u16
value is added to u16::MAX as u32 + 1
when an
Error::User
is converted to a u32
.
Trait Implementations
impl Clone for Error
[src]
fn clone(&self) -> Error
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Error
[src]
impl Debug for Error
[src]
impl Eq for Error
[src]
impl From<AddKeyFailure> for Error
[src]
fn from(error: AddKeyFailure) -> Self
[src]
impl From<CLValueError> for Error
[src]
fn from(error: CLValueError) -> Self
[src]
impl From<Error> for Error
[src]
impl From<Error> for Error
[src]
impl From<Error> for Error
[src]
impl From<Error> for u32
[src]
impl From<RemoveKeyFailure> for Error
[src]
fn from(error: RemoveKeyFailure) -> Self
[src]
impl From<SetThresholdFailure> for Error
[src]
fn from(error: SetThresholdFailure) -> Self
[src]
impl From<UpdateKeyFailure> for Error
[src]
fn from(error: UpdateKeyFailure) -> Self
[src]
impl PartialEq<Error> for Error
[src]
impl StructuralEq for Error
[src]
impl StructuralPartialEq for Error
[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> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,