pub trait CollectionExtract<S>: Send + Sync {
type Item;
// Required methods
fn extract<'s>(&self, s: &'s S) -> &'s [Self::Item];
fn change_source(&self) -> ChangeSource;
// Provided methods
fn contains(&self, _s: &S, _item: &Self::Item) -> bool { ... }
fn planning_id(&self, _item: &Self::Item) -> Option<String> { ... }
}Expand description
Extracts a slice of entities from the solution.
The associated type Item names the entity type, allowing callers to
write E: CollectionExtract<S, Item = A> when A must be inferred from E
rather than stated as a separate generic parameter.
Required Associated Types§
Required Methods§
Sourcefn extract<'s>(&self, s: &'s S) -> &'s [Self::Item]
fn extract<'s>(&self, s: &'s S) -> &'s [Self::Item]
Extracts the entity slice from the solution.
Sourcefn change_source(&self) -> ChangeSource
fn change_source(&self) -> ChangeSource
The descriptor that owns this source’s rows, or Static when no
planning-variable change can alter them. Macro-generated solution source
methods attach it through hidden internal support.
Provided Methods§
Sourcefn contains(&self, _s: &S, _item: &Self::Item) -> bool
fn contains(&self, _s: &S, _item: &Self::Item) -> bool
Reports whether this extractor’s own source-level predicate accepts an item.
Sourcefn planning_id(&self, _item: &Self::Item) -> Option<String>
fn planning_id(&self, _item: &Self::Item) -> Option<String>
The planning id constraint analysis reports for item, rendered as
described on EntityRef::planning_id.
Read only while explaining a match, never while scoring. Planning-model
entity and fact collections report their #[planning_id]; the default
reports none.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".