pub enum MigrateError {
WrongNode {
expected: &'static str,
expected_named: bool,
actual: String,
actual_named: bool,
},
WrongCategory {
category: &'static str,
actual: String,
actual_named: bool,
},
MissingField {
node: String,
field: &'static str,
},
MissingChild {
node: String,
expected: &'static str,
},
InvalidPunctuated {
node: String,
values: usize,
punctuation: usize,
},
}Expand description
A typed migration failure.
Variants§
WrongNode
A concrete typed node received the wrong backend node kind.
Fields
WrongCategory
No alternative in a typed category matched the backend node.
Fields
MissingField
A required named field was absent.
MissingChild
A required positional or anonymous child was absent.
Fields
InvalidPunctuated
A punctuated field had fewer than two values or did not contain one separator between every adjacent pair of values.
Implementations§
Source§impl MigrateError
impl MigrateError
Sourcepub fn wrong_node(
expected: &'static str,
expected_named: bool,
actual: CSTNodeClassLabel<'_>,
) -> Self
pub fn wrong_node( expected: &'static str, expected_named: bool, actual: CSTNodeClassLabel<'_>, ) -> Self
Creates a concrete node-kind mismatch.
Sourcepub fn wrong_category(
category: &'static str,
actual: CSTNodeClassLabel<'_>,
) -> Self
pub fn wrong_category( category: &'static str, actual: CSTNodeClassLabel<'_>, ) -> Self
Creates a category mismatch.
Trait Implementations§
Source§impl Clone for MigrateError
impl Clone for MigrateError
Source§fn clone(&self) -> MigrateError
fn clone(&self) -> MigrateError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MigrateError
impl Debug for MigrateError
Source§impl Display for MigrateError
impl Display for MigrateError
impl Eq for MigrateError
Source§impl Error for MigrateError
impl Error for MigrateError
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<MigrateError> for ParseError
impl From<MigrateError> for ParseError
Source§fn from(error: MigrateError) -> Self
fn from(error: MigrateError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for MigrateError
impl PartialEq for MigrateError
impl StructuralPartialEq for MigrateError
Auto Trait Implementations§
impl Freeze for MigrateError
impl RefUnwindSafe for MigrateError
impl Send for MigrateError
impl Sync for MigrateError
impl Unpin for MigrateError
impl UnsafeUnpin for MigrateError
impl UnwindSafe for MigrateError
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