pub struct ProblemFactDescriptor {
pub type_name: &'static str,
pub type_id: TypeId,
pub solution_field: &'static str,
pub is_collection: bool,
pub id_field: Option<&'static str>,
pub extractor: Option<Box<dyn EntityExtractor>>,
}Expand description
Describes a problem fact type at runtime.
Fields§
§type_name: &'static strName of the problem fact type.
type_id: TypeIdTypeId of the problem fact type.
solution_field: &'static strField name in the solution.
is_collection: boolWhether this is a collection of facts.
id_field: Option<&'static str>The ID field name, if any (for value range provider lookups).
extractor: Option<Box<dyn EntityExtractor>>Extractor for getting facts from a solution.
Implementations§
Source§impl ProblemFactDescriptor
impl ProblemFactDescriptor
Sourcepub fn new(
type_name: &'static str,
type_id: TypeId,
solution_field: &'static str,
) -> Self
pub fn new( type_name: &'static str, type_id: TypeId, solution_field: &'static str, ) -> Self
Creates a new ProblemFactDescriptor.
Sourcepub fn with_extractor(self, extractor: Box<dyn EntityExtractor>) -> Self
pub fn with_extractor(self, extractor: Box<dyn EntityExtractor>) -> Self
Sets the entity extractor for this descriptor.
Sourcepub fn with_id_field(self, field: &'static str) -> Self
pub fn with_id_field(self, field: &'static str) -> Self
Sets the ID field.
Trait Implementations§
Source§impl Clone for ProblemFactDescriptor
impl Clone for ProblemFactDescriptor
Auto Trait Implementations§
impl Freeze for ProblemFactDescriptor
impl !RefUnwindSafe for ProblemFactDescriptor
impl Send for ProblemFactDescriptor
impl Sync for ProblemFactDescriptor
impl Unpin for ProblemFactDescriptor
impl !UnwindSafe for ProblemFactDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more