Skip to main content

SimulationView

Struct SimulationView 

Source
pub struct SimulationView<'a> { /* private fields */ }

Implementations§

Source§

impl SimulationView<'_>

Source

pub const fn time(&self) -> SimTime

Source

pub fn army(&self, id: ArmyId) -> Result<Option<&Army>, CanwuError>

Source

pub fn person(&self, id: PersonId) -> Result<Option<&Person>, CanwuError>

Source

pub fn government( &self, id: GovernmentId, ) -> Result<Option<&Government>, CanwuError>

Source

pub fn territory( &self, id: TerritoryId, ) -> Result<Option<&Territory>, CanwuError>

Source

pub fn route(&self, id: RouteId) -> Result<Option<&Route>, CanwuError>

Source

pub fn actor_knowledge( &self, actor: PersonId, ) -> Result<Option<&ActorKnowledge>, CanwuError>

Source

pub fn knowledge_records( &self, holder: KnowledgeHolderRef, query: &KnowledgeQuery, ) -> Result<KnowledgeQueryResult, CanwuError>

Queries holder-relative records for an omniscient plugin system.

This enforces the declared canwu.core.knowledge read and returns an owned projection. It is not an actor-facing authorization API.

Source

pub fn command( &self, id: CommandId, ) -> Result<Option<&CommandRecord>, CanwuError>

Resolves an exact command ID from the retained runtime journal in O(1).

An archived command remains valid identity evidence, but its payload is no longer available through this view: lookup returns ErrorCode::EvidenceContentUnavailable. None means the ID has neither retained content nor a committed archive receipt.

Source

pub fn event(&self, id: EventId) -> Result<Option<&SimEvent>, CanwuError>

Resolves an exact event ID from the retained runtime journal in O(1).

An archived event remains valid identity evidence, but its payload is no longer available through this view: lookup returns ErrorCode::EvidenceContentUnavailable. None means the ID has neither retained content nor a committed archive receipt.

Source

pub fn ingress( &self, id: IngressId, ) -> Result<Option<&IngressRecord>, CanwuError>

Source

pub fn domain_record( &self, reference: &DomainRecordRef, ) -> Result<Option<&DomainRecord>, CanwuError>

Source

pub fn typed_domain_record<T: DomainRecordType>( &self, reference: &TypedDomainRecordRef<T>, ) -> Result<Option<&DomainRecord>, CanwuError>

Source

pub fn proposed_domain_record( &self, reference: &DomainRecordRef, ) -> Result<Option<&DomainRecord>, CanwuError>

Source

pub fn proposed_typed_domain_record<T: DomainRecordType>( &self, reference: &TypedDomainRecordRef<T>, ) -> Result<Option<&DomainRecord>, CanwuError>

Source

pub fn proposed_domain_record_version( &self, reference: &DomainRecordRef, ) -> Result<Option<DomainRecordVersionRef>, CanwuError>

Returns the exact evidence reference assigned to a domain-record version proposed earlier in the current boundary.

Source

pub fn domain_record_version_evidence_exists( &self, reference: &DomainRecordVersionRef, ) -> Result<bool, CanwuError>

Returns whether an exact domain-record version reference is valid at this proposal-visible cut.

This validates both the record identity/version and its establishment source. Earlier same-boundary proposals are considered before retained or archived runtime evidence.

Source

pub fn domain_records_of_kind( &self, kind: &DomainRecordKind, limit: usize, ) -> Result<Vec<DomainRecord>, CanwuError>

Returns a bounded, deterministic projection of records of one kind.

Same-boundary overlays take precedence over current state. Records are ordered by their canonical reference, so result order is replay stable.

Source

pub fn domain_records_of_kind_after( &self, kind: &DomainRecordKind, after: Option<&DomainRecordRef>, limit: usize, ) -> Result<Vec<DomainRecord>, CanwuError>

Returns one bounded deterministic page of records after a canonical record-reference cursor.

The cursor is exclusive and must name the same kind. This keeps plugin scans bounded without imposing a 10,000-record lifetime ceiling on a domain kind. Same-boundary overlays retain the same precedence as Self::domain_records_of_kind.

Source

pub fn knowledge_changes_by_correlation( &self, plugin: &str, producer_correlation: &str, ) -> Result<Vec<BoundaryKnowledgeChange>, CanwuError>

Finds committed knowledge changes produced with an exact correlation.

This supports next-boundary operation finalization without granting a plugin unrestricted access to unrelated knowledge payloads.

Source

pub fn knowledge_changes_by_correlation_prefix( &self, plugin: &str, producer_correlation_prefix: &str, ) -> Result<Vec<BoundaryKnowledgeChange>, CanwuError>

Finds committed knowledge changes whose producer correlation begins with a deterministic operation prefix.

The prefix remains plugin-scoped. This is intended for bounded multi-holder operation finalization where every holder batch must keep a unique full correlation value.

Source

pub fn reservation( &self, reservation: &ReservationRef, ) -> Result<Option<&ReservationAllocation>, CanwuError>

Source

pub fn random_range( &self, stream: &RandomStreamKey, upper_exclusive: u64, purpose: &str, ) -> Result<u64, CanwuError>

Source

pub fn random_range_for_operation( &self, stream: &RandomStreamKey, evidence: EvidenceRef, operation_kind: &str, application_operation_id: &str, target: RandomOperationTarget, draw_slot: u32, upper_exclusive: u64, purpose: &str, ) -> Result<u64, CanwuError>

Source

pub fn component( &self, state: &StateKey, entity: &EntityRef, component: &str, ) -> Result<Option<&Value>, CanwuError>

Source

pub fn proposed_component( &self, state: &StateKey, entity: &EntityRef, component: &str, ) -> Result<Option<&Value>, CanwuError>

Auto Trait Implementations§

§

impl<'a> !Freeze for SimulationView<'a>

§

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

§

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

§

impl<'a> Send for SimulationView<'a>

§

impl<'a> Unpin for SimulationView<'a>

§

impl<'a> UnsafeUnpin for SimulationView<'a>

§

impl<'a> UnwindSafe for SimulationView<'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.