Skip to main content

InsertInput

Trait InsertInput 

Source
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::entity;
#[entity(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§

Source

type Entity: Entity

The fully materialized entity admitted through the ordinary write path.

Provided Methods§

Source

fn into_entity(self) -> Result<Self::Entity, Error>

Resolve omitted fields without reading or mutating persistent state.

§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".

Implementors§