pub trait InsertInput: Sized {
type Entity: Entity;
// Provided method
fn into_entity(self) -> Result<Self::Entity, Error> { ... }
}Expand description
Typed insert construction with omission distinct from explicit optional absence.
Generated inputs implement this once per entity; execution stays in Batch.
Managed fields have no input setters:
ⓘ
use ic_db::design::prelude::*;
#[entity(store = ic_db::testing::FixtureStore, pk(field="id"), fields(
field(name="id",value(item(prim="Nat64"))),
field(name="created",value(item(prim="Timestamp")),managed="created_at")
))]
struct Entry {}
let input = Entry::insert().id(1).created(ic_db::Timestamp::from_millis(0));Required Associated Types§
Provided Methods§
Sourcefn into_entity(self) -> Result<Self::Entity, Error>
fn into_entity(self) -> Result<Self::Entity, Error>
Resolve omitted fields without reading or mutating persistent state. An omitted primitive ULID primary key consumes an ID from the local generator.
§Errors
Refuses a missing required field or managed time without a batch context. Field/row bounds are checked by batch insertion.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".