#[non_exhaustive]pub enum Primitive {
AddModel(AddModel),
RemoveModel(RemoveModel),
RenameModel(RenameModel),
AddField(AddField),
RemoveField(RemoveField),
RenameField(RenameField),
ChangeFieldType(ChangeFieldType),
ChangeFieldNullability(ChangeFieldNullability),
AddRelation(AddRelation),
RemoveRelation(RemoveRelation),
UpdateAdmin(UpdateAdmin),
CreateMigration(CreateMigration),
}Expand description
The complete set of operations the AI layer is allowed to perform on a RustIO project.
Marked #[non_exhaustive] so new primitives can land in a minor
release without breaking external matchers. Consumers must include a
wildcard arm and treat unknown variants as “refuse” rather than
guess.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AddModel(AddModel)
RemoveModel(RemoveModel)
RenameModel(RenameModel)
AddField(AddField)
RemoveField(RemoveField)
RenameField(RenameField)
ChangeFieldType(ChangeFieldType)
ChangeFieldNullability(ChangeFieldNullability)
AddRelation(AddRelation)
RemoveRelation(RemoveRelation)
UpdateAdmin(UpdateAdmin)
CreateMigration(CreateMigration)
Attach a raw SQL migration. Developer-only — this primitive
bypasses the AI boundary’s “no free-form code” rule and is
rejected by Plan::validate. Project maintainers can still
emit migrations through this type directly; the AI executor
must not.
Implementations§
Source§impl Primitive
impl Primitive
Sourcepub fn is_developer_only(&self) -> bool
pub fn is_developer_only(&self) -> bool
true if this primitive is permitted only from developer /
tooling code, not from any AI-emitted Plan.
Today, only Primitive::CreateMigration qualifies: it
accepts arbitrary SQL, which violates the AI boundary rule
that every change must be expressible as a structured
primitive. Plan::validate rejects any step for which this
returns true.
Kept as a method (not a const) so future variants can opt
in explicitly.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Primitive
impl<'de> Deserialize<'de> for Primitive
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>,
impl StructuralPartialEq for Primitive
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnsafeUnpin for Primitive
impl UnwindSafe for Primitive
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 more