trait AiQuestion:
Debug
+ Eq
+ Hash
+ Send
+ Sync
+ 'static {
type Criteria: Serialize + Send + Sync;
const NAME: &'static str;
const TYPE: &'static str;
const ARG_COUNT: usize;
// Required methods
fn return_type() -> DataType;
fn parse_criteria(args: &[&str]) -> Result<Self::Criteria>;
fn parse_answer(
answer: &Value,
criteria: &Self::Criteria,
) -> Result<ScalarValue>;
}Expand description
The request criteria and scalar answer contract for an AI question type.
Required Associated Constants§
Required Associated Types§
Required Methods§
fn return_type() -> DataType
fn parse_criteria(args: &[&str]) -> Result<Self::Criteria>
fn parse_answer( answer: &Value, criteria: &Self::Criteria, ) -> Result<ScalarValue>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.