Skip to main content

Signal

Enum Signal 

Source
#[non_exhaustive]
pub enum Signal<State, Action = String, Outcome = String> { PreAct { state: State, }, PostAct { experience: Experience<State, Action, Outcome>, }, EpisodeFinish { episode_id: String, experiences: Vec<Experience<State, Action, Outcome>>, }, Intervention { state: State, action: Action, reason: String, }, Feedback { experience: Experience<State, Action, Outcome>, score: f64, }, }
Expand description

The only five lifecycle signals accepted by a v1 runtime boundary.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

PreAct

Read memory and ask the bridge to coordinate the next action.

Fields

§state: State

Current state supplied by the host.

§

PostAct

Record an executed result and make it available to training.

Fields

§experience: Experience<State, Action, Outcome>

The completed state/action/outcome fact.

§

EpisodeFinish

Close an episode and trigger episode-level evaluation or learning.

Fields

§episode_id: String

Stable episode identifier.

§experiences: Vec<Experience<State, Action, Outcome>>

Experiences belonging to the completed episode.

§

Intervention

Apply an audited, boundary-checked human or rule intervention.

Fields

§state: State

State at which the intervention was requested.

§action: Action

Action or policy value affected by the intervention.

§reason: String

Mandatory reason retained for auditability.

§

Feedback

Accept an external evaluation as a learning signal, not a self-evaluation.

Fields

§experience: Experience<State, Action, Outcome>

Experience being evaluated.

§score: f64

External score supplied by the evaluator.

Trait Implementations§

Source§

impl<State: Clone, Action: Clone, Outcome: Clone> Clone for Signal<State, Action, Outcome>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<State: Debug, Action: Debug, Outcome: Debug> Debug for Signal<State, Action, Outcome>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, State, Action, Outcome> Deserialize<'de> for Signal<State, Action, Outcome>
where State: Deserialize<'de>, Action: Deserialize<'de>, Outcome: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<State: PartialEq, Action: PartialEq, Outcome: PartialEq> PartialEq for Signal<State, Action, Outcome>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<State, Action, Outcome> Serialize for Signal<State, Action, Outcome>
where State: Serialize, Action: Serialize, Outcome: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<State: PartialEq, Action: PartialEq, Outcome: PartialEq> StructuralPartialEq for Signal<State, Action, Outcome>

Auto Trait Implementations§

§

impl<State, Action, Outcome> Forget for Signal<State, Action, Outcome>

§

impl<State, Action, Outcome> Freeze for Signal<State, Action, Outcome>
where State: Freeze, Action: Freeze, Outcome: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<Experience<State, Action, Outcome>>: Freeze,

§

impl<State, Action, Outcome> Move for Signal<State, Action, Outcome>

§

impl<State, Action, Outcome> RefUnwindSafe for Signal<State, Action, Outcome>
where State: RefUnwindSafe, Action: RefUnwindSafe, Outcome: RefUnwindSafe,

§

impl<State, Action, Outcome> Send for Signal<State, Action, Outcome>
where Outcome: Send, Action: Send, State: Send, RawVecInner: Send,

§

impl<State, Action, Outcome> Sync for Signal<State, Action, Outcome>
where Outcome: Sync, Action: Sync, State: Sync, RawVecInner: Sync,

§

impl<State, Action, Outcome> Unpin for Signal<State, Action, Outcome>
where Outcome: Unpin, Action: Unpin, State: Unpin, *const u8 is !null: Unpin,

§

impl<State, Action, Outcome> UnsafeUnpin for Signal<State, Action, Outcome>
where State: UnsafeUnpin, Action: UnsafeUnpin, Outcome: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<Experience<State, Action, Outcome>>: UnsafeUnpin,

§

impl<State, Action, Outcome> UnwindSafe for Signal<State, Action, Outcome>
where State: UnwindSafe, Action: UnwindSafe, Outcome: UnwindSafe, RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more