#[non_exhaustive]pub enum PrimitiveError {
EmptyIdentifier(&'static str),
UnknownType {
model: String,
field: String,
ty: String,
},
DuplicateFieldInAddModel {
model: String,
field: String,
},
AlreadyExists {
what: &'static str,
name: String,
},
NotFound {
what: &'static str,
name: String,
},
UnknownRelationTarget {
from: String,
to: String,
},
UnknownAdminAttribute {
attr: String,
},
NoOpRename {
what: &'static str,
name: String,
},
DeveloperOnlyNotAllowedInPlan {
op: &'static str,
},
InStep {
step: usize,
inner: Box<PrimitiveError>,
},
}Expand description
Reasons a primitive (or a plan composed of primitives) can be rejected. The AI boundary converts these into a blunt refusal — the executor never silently “fixes” a primitive or applies a partial plan.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyIdentifier(&'static str)
A required identifier is empty (name, model, field, …).
UnknownType
A field’s declared type isn’t in VALID_TYPE_NAMES.
DuplicateFieldInAddModel
Two fields with the same name inside an add_model payload.
AlreadyExists
Target of an add_* already exists in the schema.
NotFound
Target of a remove_* / update_admin doesn’t exist.
UnknownRelationTarget
Relation target model doesn’t exist in the (shadow-applied) schema.
UnknownAdminAttribute
UpdateAdmin referenced an attribute outside the accepted vocabulary.
NoOpRename
A rename primitive was given identical from and to.
Rejecting no-ops early keeps plans honest and diff-reviewable.
DeveloperOnlyNotAllowedInPlan
A developer-only primitive appeared inside a Plan. Plans
represent the AI boundary; anything with
Primitive::is_developer_only set must be rejected before
an executor touches it.
InStep
validate_plan annotates inner errors with the step index so a
caller can point the user at “step 3 failed because …”.
Trait Implementations§
Source§impl Clone for PrimitiveError
impl Clone for PrimitiveError
Source§fn clone(&self) -> PrimitiveError
fn clone(&self) -> PrimitiveError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PrimitiveError
impl Debug for PrimitiveError
Source§impl Display for PrimitiveError
impl Display for PrimitiveError
Source§impl Error for PrimitiveError
impl Error for PrimitiveError
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()
Source§impl PartialEq for PrimitiveError
impl PartialEq for PrimitiveError
Source§fn eq(&self, other: &PrimitiveError) -> bool
fn eq(&self, other: &PrimitiveError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PrimitiveError
Auto Trait Implementations§
impl Freeze for PrimitiveError
impl RefUnwindSafe for PrimitiveError
impl Send for PrimitiveError
impl Sync for PrimitiveError
impl Unpin for PrimitiveError
impl UnsafeUnpin for PrimitiveError
impl UnwindSafe for PrimitiveError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.