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§
Sourcefn capabilities(&self) -> DynamicScalarAssignmentMetadataCapabilities
fn capabilities(&self) -> DynamicScalarAssignmentMetadataCapabilities
Metadata this group declares. An undeclared capability’s method must return its neutral result.
Sourcefn required_entity(&self, solution: &S, entity_index: usize) -> bool
fn required_entity(&self, solution: &S, entity_index: usize) -> bool
Whether the row must be assigned before the solution is complete; neutral result false.
Sourcefn capacity_key(
&self,
solution: &S,
entity_index: usize,
value: usize,
) -> Option<usize>
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.
Sourcefn position_key(&self, solution: &S, entity_index: usize) -> Option<i64>
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.
Sourcefn sequence_key(
&self,
solution: &S,
entity_index: usize,
value: usize,
) -> Option<usize>
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.
Sourcefn entity_order_key(&self, solution: &S, entity_index: usize) -> Option<i64>
fn entity_order_key(&self, solution: &S, entity_index: usize) -> Option<i64>
Ranking key for the row in entity-ordered construction; None when undeclared.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".