#[non_exhaustive]pub enum ValidationError {
UndefinedVariable {
name: String,
},
UndefinedList {
name: String,
},
CircularReference {
path: Vec<String>,
},
EmptyActionList {
list_name: String,
},
InvalidExpression {
message: String,
list_name: Option<String>,
action_index: Option<usize>,
slug: Option<String>,
},
DuplicateVariable {
name: String,
},
DuplicateList {
name: String,
},
TypeMismatch {
name: String,
op: String,
expected: String,
got: String,
list_name: Option<String>,
action_index: Option<usize>,
},
UnknownField {
domain: String,
name: String,
},
MaxDepthExceeded {
depth: usize,
max: usize,
},
ActionExpansionLimitExceeded {
actions: usize,
max: usize,
},
UnsupportedSyntax {
construct: String,
},
}Expand description
Hard validation error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
UndefinedVariable
UndefinedList
CircularReference
EmptyActionList
InvalidExpression
DuplicateVariable
DuplicateList
TypeMismatch
Fields
UnknownField
MaxDepthExceeded
ActionExpansionLimitExceeded
UnsupportedSyntax
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl<'de> Deserialize<'de> for ValidationError
impl<'de> Deserialize<'de> for ValidationError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ValidationError> for JsValuewhere
ValidationError: Serialize,
impl From<ValidationError> for JsValuewhere
ValidationError: Serialize,
Source§fn from(value: ValidationError) -> Self
fn from(value: ValidationError) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for ValidationErrorwhere
Self: DeserializeOwned,
impl FromWasmAbi for ValidationErrorwhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for &ValidationErrorwhere
ValidationError: Serialize,
impl IntoWasmAbi for &ValidationErrorwhere
ValidationError: Serialize,
Source§impl IntoWasmAbi for ValidationErrorwhere
ValidationError: Serialize,
impl IntoWasmAbi for ValidationErrorwhere
ValidationError: Serialize,
Source§impl OptionFromWasmAbi for ValidationErrorwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for ValidationErrorwhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for ValidationErrorwhere
ValidationError: Serialize,
impl OptionIntoWasmAbi for ValidationErrorwhere
ValidationError: Serialize,
Source§impl RefFromWasmAbi for ValidationErrorwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for ValidationErrorwhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = SelfOwner<ValidationError>
type Anchor = SelfOwner<ValidationError>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl Serialize for ValidationError
impl Serialize for ValidationError
Source§impl Tsify for ValidationError
impl Tsify for ValidationError
const DECL: &'static str = "/**\n * Hard validation error.\n */\nexport type ValidationError = { type: \"undefinedVariable\"; name: string } | { type: \"undefinedList\"; name: string } | { type: \"circularReference\"; path: string[] } | { type: \"emptyActionList\"; list_name: string } | { type: \"invalidExpression\"; message: string; list_name?: string; action_index?: number; slug?: string } | { type: \"duplicateVariable\"; name: string } | { type: \"duplicateList\"; name: string } | { type: \"typeMismatch\"; name: string; op: string; expected: string; got: string; list_name?: string; action_index?: number } | { type: \"unknownField\"; domain: string; name: string } | { type: \"maxDepthExceeded\"; depth: number; max: number } | { type: \"actionExpansionLimitExceeded\"; actions: number; max: number } | { type: \"unsupportedSyntax\"; construct: string };"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl VectorFromWasmAbi for ValidationErrorwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for ValidationErrorwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for ValidationErrorwhere
ValidationError: Serialize,
impl VectorIntoWasmAbi for ValidationErrorwhere
ValidationError: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribe for ValidationError
impl WasmDescribe for ValidationError
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.Source§impl<T> SpecConfig for T
impl<T> SpecConfig for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of [
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more