pub struct Abort;
Expand description
A simple type used in conjunction with FunctionError representing that the function should abort without a custom message.
use near_sdk::{Abort, near};
#[near(contract_state)]
#[derive(Default)]
pub struct Contract;
#[near]
impl Contract {
#[handle_result]
pub fn foo(&self, text: &str) -> Result<String, Abort> {
if text == "success" {
Ok("success".to_string())
} else {
Err(Abort)
}
}
}
Trait Implementations§
source§impl PartialEq for Abort
impl PartialEq for Abort
impl Eq for Abort
impl StructuralPartialEq for Abort
Auto Trait Implementations§
impl Freeze for Abort
impl RefUnwindSafe for Abort
impl Send for Abort
impl Sync for Abort
impl Unpin for Abort
impl UnwindSafe for Abort
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