pub struct SelectionContext<'a> {
pub tags: FxHashSet<String>,
pub entity_bindings: HashMap<String, &'a Entity>,
pub depth: u32,
pub voice_weights: Option<&'a HashMap<String, f32>>,
pub markov_models: HashMap<String, &'a MarkovModel>,
}Expand description
Accumulated state during grammar expansion.
Fields§
§entity_bindings: HashMap<String, &'a Entity>§depth: u32§voice_weights: Option<&'a HashMap<String, f32>>Optional voice grammar weight overrides (rule_name → multiplier).
markov_models: HashMap<String, &'a MarkovModel>Loaded Markov models keyed by corpus_id.
Implementations§
Source§impl<'a> SelectionContext<'a>
impl<'a> SelectionContext<'a>
pub fn new() -> Self
pub fn with_entity(self, role: &str, entity: &'a Entity) -> Self
pub fn with_markov(self, corpus_id: &str, model: &'a MarkovModel) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SelectionContext<'a>
impl<'a> RefUnwindSafe for SelectionContext<'a>
impl<'a> Send for SelectionContext<'a>
impl<'a> Sync for SelectionContext<'a>
impl<'a> Unpin for SelectionContext<'a>
impl<'a> UnsafeUnpin for SelectionContext<'a>
impl<'a> UnwindSafe for SelectionContext<'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