Skip to main content

DynamicScalarAssignmentMetadata

Trait DynamicScalarAssignmentMetadata 

Source
pub trait DynamicScalarAssignmentMetadata<S>: Send + Sync {
    // Required methods
    fn capabilities(&self) -> DynamicScalarAssignmentMetadataCapabilities;
    fn required_entity(&self, solution: &S, entity_index: usize) -> bool;
    fn capacity_key(
        &self,
        solution: &S,
        entity_index: usize,
        value: usize,
    ) -> Option<usize>;
    fn position_key(&self, solution: &S, entity_index: usize) -> Option<i64>;
    fn sequence_key(
        &self,
        solution: &S,
        entity_index: usize,
        value: usize,
    ) -> Option<usize>;
    fn entity_order_key(&self, solution: &S, entity_index: usize) -> Option<i64>;
    fn value_order_key(
        &self,
        solution: &S,
        entity_index: usize,
        value: usize,
    ) -> Option<i64>;
    fn assignment_edge_allowed(
        &self,
        solution: &S,
        left_entity: usize,
        left_value: usize,
        right_entity: usize,
        right_value: usize,
    ) -> bool;
}
Expand description

Object-safe metadata access for one dynamic scalar-assignment group.

Implementors are bound to a concrete group at model compilation time. They must not select a group indirectly from thread-local state, a runtime name lookup, or the active phase. Typed Rust groups retain their direct function-pointer metadata and never use this dynamic boundary.

Required Methods§

Source

fn capabilities(&self) -> DynamicScalarAssignmentMetadataCapabilities

Metadata this group declares. An undeclared capability’s method must return its neutral result.

Source

fn required_entity(&self, solution: &S, entity_index: usize) -> bool

Whether the row must be assigned before the solution is complete; neutral result false.

Source

fn capacity_key( &self, solution: &S, entity_index: usize, value: usize, ) -> Option<usize>

Capacity key consumed by assigning value to the row; at most one assigned row may hold each key. None consumes no capacity.

Source

fn position_key(&self, solution: &S, entity_index: usize) -> Option<i64>

Position of the row used to order assigned rows; None when the row has no position.

Source

fn sequence_key( &self, solution: &S, entity_index: usize, value: usize, ) -> Option<usize>

Position of the (row, value) assignment in the value’s sequence; rows at sequence keys k and k + 1 for the same value are adjacent. None when unsequenced.

Source

fn entity_order_key(&self, solution: &S, entity_index: usize) -> Option<i64>

Ranking key for the row in entity-ordered construction; None when undeclared.

Source

fn value_order_key( &self, solution: &S, entity_index: usize, value: usize, ) -> Option<i64>

Ranking key for value on the row in value-ordered construction; None when undeclared.

Source

fn assignment_edge_allowed( &self, solution: &S, left_entity: usize, left_value: usize, right_entity: usize, right_value: usize, ) -> bool

Whether left_entity holding left_value may directly precede right_entity holding right_value in a sequence; neutral result true.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§