Skip to main content

ChildOccurrenceShape

Trait ChildOccurrenceShape 

Source
pub trait ChildOccurrenceShape {
    type Empty;
    type Member<Occurrence, Child: Behavior, Tail>;
}
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.

use core::marker::PhantomData;
use behavior::{Behavior, ChildOccurrenceShape, ChildOccurrences};

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

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

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

Required Associated Types§

Source

type Empty

Representation of the empty Never node.

Source

type Member<Occurrence, Child: Behavior, Tail>

Representation of one concrete child followed by the remaining product.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§