Type Alias Result
Source pub type Result<T> = Result<T, Error>;
Expand description
Result type alias using Error as the error type.
This is the standard result type for all SDK and contract functions.
§Example
ⓘfn transfer(to: AccountId, amount: u64) -> Result<()> {
if amount == 0 {
return Err(Error::new(ERR_INVALID_AMOUNT));
}
Ok(())
}
pub enum Result<T> {
Ok(T),
Err(Error),
}
Contains the success value