pub enum Projection {
Borrowed,
Copied,
Repeated,
Optional,
}Expand description
How a column is handed out by an accessor.
One marker, one projection — the variants are mutually exclusive by construction, which is why
this is an enum rather than a set of flags. Nothing is INFERRED: an unmarked field takes
Projection::Borrowed, and removing a marker changes an accessor’s shape as a visible source
change rather than silently.
Variants§
Borrowed
Unmarked: x_ref(&self) -> &T.
Copied
#[ingraph(copy)]: x(&self) -> T IN ADDITION to the borrow, and const mutators.
It is a CLAIM, not a fact the emitter can check: a model carries names and types, not trait
implementations, so a column marked copy whose type is not Copy produces an emission that
does not compile. The error lands on the generated accessor (“cannot move out of self.x”),
which names the column, so the claim that was wrong is identifiable.
Repeated
#[ingraph(repeated)]: x_slice(&self) -> &[<T as Repeated>::Item].
Optional
#[ingraph(optional)]: x_ref(&self) -> Option<&<T as Optional>::Item>.