Skip to main content

TemporalResponseSpec

Struct TemporalResponseSpec 

Source
pub struct TemporalResponseSpec {
    pub horizons: Arc<[u32]>,
    pub policy: TemporalPolicy,
    pub max_history_lag: Option<u32>,
}
Expand description

Temporal attachment for a continuous-response query (ADR 0021).

When present, the query is a temporal cell: dose × horizon surfaces for ResponseFunctional::MeanCurve, or horizon-indexed intervention responses. Absence means a static response cell.

Fields§

§horizons: Arc<[u32]>

Outcome evaluation horizons in time steps after the policy origin (each ≥ 1). Strictly increasing; at least one entry.

§policy: TemporalPolicy

Temporal intervention policy. Licensed 0.7 cells are Pulse and single-step Sustained; Dynamic is refused here (use TemporalEffectQuery).

§max_history_lag: Option<u32>

Optional max history lag (steps) when unfolding; None = planner default.

Implementations§

Source§

impl TemporalResponseSpec

Source

pub const MAX_HORIZONS: usize = MAX_TEMPORAL_RESPONSE_HORIZONS

Horizon-count cap (MAX_TEMPORAL_RESPONSE_HORIZONS).

Source

pub const POLICY_PULSE: &'static str = "pulse"

Source

pub const POLICY_SUSTAINED: &'static str = "sustained"

Source

pub const ALLOWED_POLICIES: &'static [&'static str]

Policies Self::validate accepts on a response cell.

Source

pub const DEFAULT_POLICY: &'static str = Self::POLICY_PULSE

Default wire tag when a facade omits policy.

Source

pub const DEFAULT_TREATMENT_LAG: u32 = 1

Default treatment_lag (policy origin -lag).

Source

pub const fn license() -> TemporalResponseLicense

Machine-readable license for facades. Python must not hard-code these.

Source

pub fn parse_policy(tag: &str, at: i32) -> Result<TemporalPolicy, QueryError>

Parse a licensed response-policy wire tag at treatment offset at.

Sustained is the licensed single-step window [at, at].

§Errors

Unknown tag (including dynamic).

Source

pub fn new( horizons: impl Into<Arc<[u32]>>, policy: TemporalPolicy, max_history_lag: Option<u32>, ) -> Result<Self, QueryError>

Construct a temporal attachment after validating horizons and policy.

§Errors

Empty/non-increasing/oversized horizons, zero horizon, or invalid policy.

Source

pub fn validate(&self) -> Result<(), QueryError>

Validate horizons and nested policy.

§Errors

QueryError::InvalidResponse or temporal-policy errors.

Source

pub fn max_horizon(&self) -> u32

Largest requested horizon (guaranteed ≥ 1 after validation).

Source

pub fn treatment_offset(&self) -> Result<i32, QueryError>

Treatment-time origin under the attached policy.

§Errors

Empty dynamic schedule.

Trait Implementations§

Source§

impl Clone for TemporalResponseSpec

Source§

fn clone(&self) -> TemporalResponseSpec

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 Debug for TemporalResponseSpec

Source§

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

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

impl PartialEq for TemporalResponseSpec

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TemporalResponseSpec

Auto Trait Implementations§

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.