Enum dharitri_wasm::types::SCResult
source · pub enum SCResult<T> {
Ok(T),
Err(SCError),
}Expand description
Default way to optionally return an error from a smart contract endpoint.
Variants§
Implementations§
source§impl<T> SCResult<T>
impl<T> SCResult<T>
pub fn is_ok(&self) -> bool
pub fn is_err(&self) -> bool
pub fn ok(self) -> Option<T>
pub fn err(self) -> Option<SCError>
sourcepub fn from_result<E>(r: Result<T, E>) -> Self
pub fn from_result<E>(r: Result<T, E>) -> Self
Used to convert from a regular Rust result.
Any error type is accepted as long as it can be converted to a SCError
(Vec<u8>, &[u8], BoxedBytes, String, &str are covered).
Trait Implementations§
source§impl<FA, T> EndpointResult<FA> for SCResult<T>
impl<FA, T> EndpointResult<FA> for SCResult<T>
source§impl<T: PartialEq> PartialEq for SCResult<T>
impl<T: PartialEq> PartialEq for SCResult<T>
source§impl<T: TypeAbi> TypeAbi for SCResult<T>
impl<T: TypeAbi> TypeAbi for SCResult<T>
fn type_name() -> String
source§fn provide_type_descriptions<TDC: TypeDescriptionContainer>(
accumulator: &mut TDC
)
fn provide_type_descriptions<TDC: TypeDescriptionContainer>( accumulator: &mut TDC )
A type can provide more than its own description.
For instance, a struct can also provide the descriptions of the type of its fields.
TypeAbi doesn’t care for the exact accumulator type,
which is abstracted by the TypeDescriptionContainer trait.
impl<T: Eq> Eq for SCResult<T>
impl<T> StructuralEq for SCResult<T>
impl<T> StructuralPartialEq for SCResult<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for SCResult<T>where
T: RefUnwindSafe,
impl<T> Send for SCResult<T>where
T: Send,
impl<T> Sync for SCResult<T>where
T: Sync,
impl<T> Unpin for SCResult<T>where
T: Unpin,
impl<T> UnwindSafe for SCResult<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more