pub struct Goal {
pub id: String,
pub name: String,
pub want: String,
pub manners: Vec<String>,
pub max_turns: u32,
pub locale: Option<Locale>,
pub setup: Setup,
pub reached: Reached,
}Expand description
One goal: what the person wants, how they talk, where they start and what proves it done.
Fields§
§id: StringStable identifier; reports join on it.
name: StringOne sentence a human reads in a report.
want: StringWhat the person wants, in words for the simulator, with every value it needs.
manners: Vec<String>How the person talks, one conversation each: «terse», «changes their mind».
max_turns: u32The turns the person takes at most before giving up.
locale: Option<Locale>The person’s locale, English when unset.
setup: SetupThe world before the first turn.
reached: ReachedThe state that proves the goal reached, checked without a model.
Implementations§
Source§impl Goal
impl Goal
Sourcepub fn validate(&self) -> Result<(), CorpusError>
pub fn validate(&self) -> Result<(), CorpusError>
Sourcepub fn item(&self) -> EvalItem
pub fn item(&self) -> EvalItem
The item a harness prepares the goal’s world from; its turn is never taken.
Sourcepub fn load_dir(dir: impl AsRef<Path>) -> Result<Vec<Self>, CorpusError>
pub fn load_dir(dir: impl AsRef<Path>) -> Result<Vec<Self>, CorpusError>
Every .toml goal in dir, sorted by id and validated.
§Errors
CorpusError for a file that cannot be read, parsed or validated, or two goals
sharing an id.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Goal
impl<'de> Deserialize<'de> for Goal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Goal
Auto Trait Implementations§
impl Freeze for Goal
impl RefUnwindSafe for Goal
impl Send for Goal
impl Sync for Goal
impl Unpin for Goal
impl UnsafeUnpin for Goal
impl UnwindSafe for Goal
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