pub struct RuleTranslator {
pub thresholds: Thresholds,
}Expand description
Rule-based translator that converts state to context using threshold rules.
This is the reference implementation that provides full transparency into how state values affect generated guidelines.
Fields§
§thresholds: ThresholdsThresholds for determining “high” and “low” axis values.
Implementations§
Source§impl RuleTranslator
impl RuleTranslator
Sourcepub fn new(thresholds: Thresholds) -> Self
pub fn new(thresholds: Thresholds) -> Self
Create a new RuleTranslator with the given thresholds.
Sourcepub fn with_thresholds(hi: f32, lo: f32) -> Self
pub fn with_thresholds(hi: f32, lo: f32) -> Self
Create a RuleTranslator with custom high/low thresholds.
Trait Implementations§
Source§impl Clone for RuleTranslator
impl Clone for RuleTranslator
Source§fn clone(&self) -> RuleTranslator
fn clone(&self) -> RuleTranslator
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RuleTranslator
impl Debug for RuleTranslator
Source§impl Default for RuleTranslator
impl Default for RuleTranslator
Source§fn default() -> RuleTranslator
fn default() -> RuleTranslator
Returns the “default value” for a type. Read more
Source§impl Translator for RuleTranslator
impl Translator for RuleTranslator
Source§fn to_prompt_context(&self, snapshot: &StateSnapshot) -> PromptContext
fn to_prompt_context(&self, snapshot: &StateSnapshot) -> PromptContext
Translate a state snapshot into prompt context.
Auto Trait Implementations§
impl Freeze for RuleTranslator
impl RefUnwindSafe for RuleTranslator
impl Send for RuleTranslator
impl Sync for RuleTranslator
impl Unpin for RuleTranslator
impl UnwindSafe for RuleTranslator
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)