pub struct BasicHarness<E, P, A, S, T> { /* private fields */ }Expand description
Minimal in-process harness implementation.
Implementations§
Source§impl BasicHarness<NoopEffectExecutor, DefaultPolicyEngine, AlwaysDenyApprovalBroker, NoopAuditSink, NoopTranscriptStore>
impl BasicHarness<NoopEffectExecutor, DefaultPolicyEngine, AlwaysDenyApprovalBroker, NoopAuditSink, NoopTranscriptStore>
Sourcepub fn noop() -> BasicHarness<NoopEffectExecutor, DefaultPolicyEngine, AlwaysDenyApprovalBroker, NoopAuditSink, NoopTranscriptStore>
pub fn noop() -> BasicHarness<NoopEffectExecutor, DefaultPolicyEngine, AlwaysDenyApprovalBroker, NoopAuditSink, NoopTranscriptStore>
Constructs a harness that performs no side effects.
Source§impl<E, P, A, S, T> BasicHarness<E, P, A, S, T>
impl<E, P, A, S, T> BasicHarness<E, P, A, S, T>
Sourcepub fn new(
executor: E,
policy: P,
approval: A,
audit: S,
transcript: T,
) -> BasicHarness<E, P, A, S, T>
pub fn new( executor: E, policy: P, approval: A, audit: S, transcript: T, ) -> BasicHarness<E, P, A, S, T>
Constructs a harness from its lifecycle components.
Sourcepub fn with_config(self, config: HarnessConfig) -> BasicHarness<E, P, A, S, T>
pub fn with_config(self, config: HarnessConfig) -> BasicHarness<E, P, A, S, T>
Replaces harness configuration.
Sourcepub fn with_noop_redactor(self) -> BasicHarness<E, P, A, S, T>
pub fn with_noop_redactor(self) -> BasicHarness<E, P, A, S, T>
Uses the default no-op redactor.
Sourcepub fn with_redactor(
self,
redactor: impl Redactor + 'static,
) -> BasicHarness<E, P, A, S, T>
pub fn with_redactor( self, redactor: impl Redactor + 'static, ) -> BasicHarness<E, P, A, S, T>
Replaces the output redactor used before observations are returned, audited, or stored in transcripts.
Trait Implementations§
Source§impl<E, P, A, S, T> Debug for BasicHarness<E, P, A, S, T>
impl<E, P, A, S, T> Debug for BasicHarness<E, P, A, S, T>
Source§impl<E, P, A, S, T> Harness for BasicHarness<E, P, A, S, T>
impl<E, P, A, S, T> Harness for BasicHarness<E, P, A, S, T>
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
request: EffectRequest,
context: &'life1 RunContext,
) -> Pin<Box<dyn Future<Output = Result<EffectObservation, HarnessError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BasicHarness<E, P, A, S, T>: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
request: EffectRequest,
context: &'life1 RunContext,
) -> Pin<Box<dyn Future<Output = Result<EffectObservation, HarnessError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BasicHarness<E, P, A, S, T>: 'async_trait,
Executes one effect through the harness lifecycle.
Source§fn execute_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
requests: Vec<EffectRequest>,
context: &'life1 RunContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<EffectObservation>, HarnessError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn execute_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
requests: Vec<EffectRequest>,
context: &'life1 RunContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<EffectObservation>, HarnessError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Executes a batch of effects. Read more
Auto Trait Implementations§
impl<E, P, A, S, T> !Freeze for BasicHarness<E, P, A, S, T>
impl<E, P, A, S, T> !RefUnwindSafe for BasicHarness<E, P, A, S, T>
impl<E, P, A, S, T> !UnwindSafe for BasicHarness<E, P, A, S, T>
impl<E, P, A, S, T> Send for BasicHarness<E, P, A, S, T>
impl<E, P, A, S, T> Sync for BasicHarness<E, P, A, S, T>
impl<E, P, A, S, T> Unpin for BasicHarness<E, P, A, S, T>
impl<E, P, A, S, T> UnsafeUnpin for BasicHarness<E, P, A, S, T>
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