Skip to main content

ChildOccurrenceShape

Trait ChildOccurrenceShape 

Source
pub trait ChildOccurrenceShape {
    type Empty;
}
Expand description

Downstream shape of one direct-child occurrence product.

Behavior owns the closed node algebra: a concrete Behavior leaf, ChildChoice, or Never. A runtime owns the representation associated with each leaf. Empty supplies its terminal representation and Member receives one concrete child, its structural occurrence, and the remaining child product.

This is a type-level derived construction. It creates no value, allocates no actor, interprets no effect, and introduces no protocol identity or runtime key. A shape that builds a heterogeneous product should retain Tail; the product includes every declared child exactly once.

struct NoChildBindings;
struct ChildBinding<Position, Child, Tail>(core::marker::PhantomData<fn() -> (Position, Child, Tail)>);
struct RuntimeStorage;

impl behavior::ChildOccurrenceShape for RuntimeStorage {
    type Empty = NoChildBindings;
}
impl<Occurrence, Child: behavior::Behavior, Tail>
    behavior::ChildOccurrenceMember<Occurrence, Child, Tail> for RuntimeStorage
{
    type Member = ChildBinding<Occurrence, Child, Tail>;
}

type ChildBindings<Node> = behavior::ChildOccurrences<Node, RuntimeStorage>;

Required Associated Types§

Source

type Empty

Representation of the empty Never node.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§