pub enum ViewResult<View, Error> {
Success(View),
ContractError(Error),
RuntimeError(String),
}Expand description
Return type for ‘view’ contract method
User is responsible for providing View and Error types. To use them with #[warp_contract(view)] macro they
both have to implement Debug and Serialize. This allows passing them from rust to js.
Variants§
Success(View)
returned on success - View contains the result
ContractError(Error)
returned when a ‘business’ error occurred, The user-defined Error parameter is returned to the caller
RuntimeError(String)
returned when an unexpected error occurred, The String parameter is for debugging purposes
Trait Implementations§
Auto Trait Implementations§
impl<View, Error> Freeze for ViewResult<View, Error>
impl<View, Error> RefUnwindSafe for ViewResult<View, Error>where
View: RefUnwindSafe,
Error: RefUnwindSafe,
impl<View, Error> Send for ViewResult<View, Error>
impl<View, Error> Sync for ViewResult<View, Error>
impl<View, Error> Unpin for ViewResult<View, Error>
impl<View, Error> UnwindSafe for ViewResult<View, Error>where
View: UnwindSafe,
Error: 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