Enum BlockJsonStructureError
pub enum BlockJsonStructureError {
IdNotFound,
BlockIsNoMapping,
MissingMandatoryAttr(&'static str),
AttrWrongType {
attr: &'static str,
correct_type: &'static str,
},
}Expand description
General block parsing failed because of the json structure, this is not about attributes.
Variants§
IdNotFound
The requested block Id wasn’t found in the
target’s json mapping blocks
This should rarely occur as multiple program parts only request blocks
that were previously found in the file by e. g. iterating over all
block Ids
BlockIsNoMapping
The found block data (for the requested Id) is not
a json mapping ({ ... }). This should never happen in a valid file.
MissingMandatoryAttr(&'static str)
Mapping is missing a needed key-value-pair, like inputs or fields.
Regardless of the block’s kind or opcode, some attributes need to be present.
Examples of such attributes are opcode or inputs.
For procedures the mutation key has to be present additionally.
AttrWrongType
A block property is of invalid form, this is not about attributes like in crate::attrs.
inputs, fields and mutation need to be – if present – json mappings from
attribute names to their values. An opcode should be a string. This error
indicates that one of those expectations was violated.
Trait Implementations§
§impl Clone for BlockJsonStructureError
impl Clone for BlockJsonStructureError
§fn clone(&self) -> BlockJsonStructureError
fn clone(&self) -> BlockJsonStructureError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for BlockJsonStructureError
impl Debug for BlockJsonStructureError
§impl Display for BlockJsonStructureError
impl Display for BlockJsonStructureError
§impl Error for BlockJsonStructureError
impl Error for BlockJsonStructureError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
§impl<'a> From<BlockJsonStructureError> for BlockKindError<'a>
impl<'a> From<BlockJsonStructureError> for BlockKindError<'a>
§fn from(source: BlockJsonStructureError) -> BlockKindError<'a>
fn from(source: BlockJsonStructureError) -> BlockKindError<'a>
§impl PartialEq for BlockJsonStructureError
impl PartialEq for BlockJsonStructureError
impl StructuralPartialEq for BlockJsonStructureError
Auto Trait Implementations§
impl Freeze for BlockJsonStructureError
impl RefUnwindSafe for BlockJsonStructureError
impl Send for BlockJsonStructureError
impl Sync for BlockJsonStructureError
impl Unpin for BlockJsonStructureError
impl UnsafeUnpin for BlockJsonStructureError
impl UnwindSafe for BlockJsonStructureError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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