pub struct Scenario<'a> { /* private fields */ }Expand description
The representation of a scenario. A moment consisting of various events, the present actors and any predicates that apply to either.
Implementations§
Source§impl<'a> Scenario<'a>
impl<'a> Scenario<'a>
Sourcepub fn new(
actors: Vec<Actor<'a>>,
thematic_relations: Vec<ThetaRoles<'a>>,
properties: BTreeMap<&'a str, Vec<Entity<'a>>>,
) -> Scenario<'a>
pub fn new( actors: Vec<Actor<'a>>, thematic_relations: Vec<ThetaRoles<'a>>, properties: BTreeMap<&'a str, Vec<Entity<'a>>>, ) -> Scenario<'a>
Create a new scenario.
Sourcepub fn thematic_relations(&self) -> &[ThetaRoles<'a>]
pub fn thematic_relations(&self) -> &[ThetaRoles<'a>]
Get the representation of all events as a slice of ThetaRoles.
Sourcepub fn properties(&self) -> &BTreeMap<&'a str, Vec<Entity<'a>>>
pub fn properties(&self) -> &BTreeMap<&'a str, Vec<Entity<'a>>>
Get the properties (e.g. what predicates apply) of the entities in a scenario.
Sourcepub fn questions(&self) -> &[RootedLambdaPool<'a, Expr<'a>>]
pub fn questions(&self) -> &[RootedLambdaPool<'a, Expr<'a>>]
Get the questions associated with a scenario (which may be empty if there are no questions).
Questions are representated as RootedLambdaPool which return a truth value.
Sourcepub fn question_mut(&mut self) -> &mut Vec<RootedLambdaPool<'a, Expr<'a>>>
pub fn question_mut(&mut self) -> &mut Vec<RootedLambdaPool<'a, Expr<'a>>>
Get a mutable reference to the questions of a scenario.
See Scenario::questions
Trait Implementations§
impl<'a> Eq for Scenario<'a>
impl<'a> StructuralPartialEq for Scenario<'a>
Auto Trait Implementations§
impl<'a> Freeze for Scenario<'a>
impl<'a> RefUnwindSafe for Scenario<'a>
impl<'a> Send for Scenario<'a>
impl<'a> Sync for Scenario<'a>
impl<'a> Unpin for Scenario<'a>
impl<'a> UnwindSafe for Scenario<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
An iterator over the items within this container, by reference.
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
Check whether an item is contained within this sequence.
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
Convert an item of the sequence into a [
MaybeRef].