pub struct Fail {
pub outcome: Outcome,
pub code: String,
pub message: String,
pub hint: Option<String>,
pub extra: Map<String, Value>,
}Fields§
§outcome: Outcome§code: String§message: String§hint: Option<String>§extra: Map<String, Value>Extra top-level fields for the result (candidates, element, …).
Implementations§
Source§impl Fail
impl Fail
pub fn new(outcome: Outcome, code: &str, message: impl Into<String>) -> Self
pub fn not_sent(code: &str, message: impl Into<String>) -> Self
pub fn unknown(code: &str, message: impl Into<String>) -> Self
pub fn invalid(message: impl Into<String>) -> Self
pub fn hint(self, hint: impl Into<String>) -> Self
pub fn with(self, key: &str, value: impl Into<Value>) -> Self
pub fn error_json(&self) -> Value
Trait Implementations§
Auto Trait Implementations§
impl Forget for Fail
impl Freeze for Fail
impl Move for Fail
impl RefUnwindSafe for Fail
impl Send for Fail
impl Sync for Fail
impl Unpin for Fail
impl UnsafeUnpin for Fail
impl UnwindSafe for Fail
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