#[non_exhaustive]pub enum PlanError {
EmptyPrompt,
InvalidIntent(String),
UnknownModel {
hint: String,
},
AmbiguousModel {
hint: String,
candidates: Vec<String>,
},
FieldAlreadyExists {
model: String,
field: String,
},
FieldDoesNotExist {
model: String,
field: String,
},
DeveloperOnlyRequested(&'static str),
CoreModelProtected(String),
UnknownType(String),
Validation(PrimitiveError),
ContextParse(String),
}Expand description
Every reason the planner can refuse. Named variants so downstream tooling can branch on kind instead of parsing strings.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyPrompt
Prompt was empty or whitespace only.
InvalidIntent(String)
Prompt didn’t match any supported grammar.
UnknownModel
Prompt referenced a model the schema doesn’t know about.
AmbiguousModel
Prompt referenced a model name that matched more than one registered model (e.g. under both struct name and singular form). The candidates are surfaced so the caller can re-prompt with a specific name.
FieldAlreadyExists
add_field would collide with an existing field.
FieldDoesNotExist
remove_field / rename_field / change_* referenced a field
that doesn’t exist on the resolved model.
DeveloperOnlyRequested(&'static str)
User asked for something only a developer may do (e.g. raw
SQL, create_migration). The planner refuses up front.
CoreModelProtected(String)
Planner-proposed an operation that would modify a core: true
model (e.g. User). Refused.
UnknownType(String)
Unknown type hint the user supplied (as foobar).
Validation(PrimitiveError)
The composed plan failed Plan::validate — the schema-aware
simulation disagreed with the proposed primitive. Wrapped error
carries the step index + reason.
ContextParse(String)
rustio.context.json existed but failed to parse.
Trait Implementations§
Source§impl Error for PlanError
impl Error for PlanError
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 StructuralPartialEq for PlanError
Auto Trait Implementations§
impl Freeze for PlanError
impl RefUnwindSafe for PlanError
impl Send for PlanError
impl Sync for PlanError
impl Unpin for PlanError
impl UnsafeUnpin for PlanError
impl UnwindSafe for PlanError
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.