pub struct MemoryReflexService { /* private fields */ }Expand description
Gates System 1 answers into a memory envelope a host can put on its own bus.
Implementations§
Source§impl MemoryReflexService
impl MemoryReflexService
pub fn new(decider: Arc<dyn System1Decider>) -> Self
Sourcepub fn heuristic() -> Self
pub fn heuristic() -> Self
Attach the offline lexical decider. It speaks the catalog; it is not a checkpoint.
pub fn with_policy(self, policy: ReflexPolicy) -> Self
pub fn policy(&self) -> ReflexPolicy
Sourcepub fn request_for(&self, stimulus: &MemoryStimulus) -> System1Request
pub fn request_for(&self, stimulus: &MemoryStimulus) -> System1Request
The exact System 1 request decide would send. A host that already ran
Laya can POST this body, parse the response, and call Self::apply.
Sourcepub async fn decide(&self, stimulus: &MemoryStimulus) -> Result<MemoryReflex>
pub async fn decide(&self, stimulus: &MemoryStimulus) -> Result<MemoryReflex>
Run the attached decider, then gate the answers.
Sourcepub fn apply(
&self,
stimulus: &MemoryStimulus,
decision: &System1Response,
) -> Result<MemoryReflex>
pub fn apply( &self, stimulus: &MemoryStimulus, decision: &System1Response, ) -> Result<MemoryReflex>
Gate a forward pass the host already ran. The attached decider is not called.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryReflexService
impl !UnwindSafe for MemoryReflexService
impl Freeze for MemoryReflexService
impl Send for MemoryReflexService
impl Sync for MemoryReflexService
impl Unpin for MemoryReflexService
impl UnsafeUnpin for MemoryReflexService
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