Skip to main content

AnswerSchema

Trait AnswerSchema 

Source
pub trait AnswerSchema: Clone {
    type Answers<'a>;

    // Required method
    fn parse<'a>(
        &self,
        raw: &'a DecisionResponse,
        questions: &'a Questions,
    ) -> Result<Self::Answers<'a>, Error>;
}
Expand description

Constructs borrowed answer fields for a request shape.

Usually generated by crate::questions!. Implementations must use request keys to select fields; missing keys or mismatched answer kinds must return an error.

Required Associated Types§

Source

type Answers<'a>

Named fields or a map of checked answer variants, borrowed from the response.

Required Methods§

Source

fn parse<'a>( &self, raw: &'a DecisionResponse, questions: &'a Questions, ) -> Result<Self::Answers<'a>, Error>

Build checked views without copying probability maps or borrowing question definitions.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§