Skip to main content

EntityQueryHandle

Struct EntityQueryHandle 

Source
pub struct EntityQueryHandle<'a> { /* private fields */ }
Expand description

A handle for querying entity state at different timestamps.

This handle provides the state_at() method, which is the primary consumer API for getting entity state at any point in time.

Implementations§

Source§

impl<'a> EntityQueryHandle<'a>

Source

pub fn entity_id(&self) -> &EntityId

Returns the entity ID.

Source

pub fn anchor_timestamp(&self) -> Option<Timestamp>

Returns the anchor timestamp for this entity.

Source

pub fn state_at(&self, timestamp: Timestamp) -> ComputedState

Computes the entity’s state at the given timestamp.

This is the primary consumer API. It computes state by:

  1. Starting from the anchor state
  2. Applying decay forward or reversing backward
  3. Applying events in the time range
§Arguments
  • timestamp - The time at which to compute state
§Returns

The computed state, or None if the entity doesn’t exist.

Source

pub fn trust_decision_for( &self, trustee: &EntityId, timestamp: Timestamp, context: &TrustContext, life_domain: LifeDomain, stakes: Option<ActionStakes>, ) -> Option<TrustDecision>

Computes the trust decision for this entity (trustor) toward a trustee at a timestamp.

This wires together the trustor’s dispositional propensity at the time, the current relationship state, the provided situational context, and the relevant life domain for competence. stakes optionally scales perceived risk based on consequence severity.

Source

pub fn memories_at(&self, timestamp: Timestamp) -> Vec<MemoryEntry>

Returns memories that exist at the given timestamp.

A memory “exists” at a timestamp if it was formed before or at that time. This method returns all memories from the entity’s memory layers that were formed at or before the specified timestamp.

§Arguments
  • timestamp - The time at which to query existing memories
§Returns

A vector of cloned memory entries that exist at the timestamp. Returns an empty vector if the entity doesn’t exist.

Auto Trait Implementations§

§

impl<'a> Freeze for EntityQueryHandle<'a>

§

impl<'a> !RefUnwindSafe for EntityQueryHandle<'a>

§

impl<'a> !Send for EntityQueryHandle<'a>

§

impl<'a> !Sync for EntityQueryHandle<'a>

§

impl<'a> Unpin for EntityQueryHandle<'a>

§

impl<'a> !UnwindSafe for EntityQueryHandle<'a>

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> 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, 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.