pub struct SimulationView<'a> { /* private fields */ }Implementations§
Source§impl SimulationView<'_>
impl SimulationView<'_>
pub const fn time(&self) -> SimTime
pub fn army(&self, id: ArmyId) -> Result<Option<&Army>, CanwuError>
pub fn person(&self, id: PersonId) -> Result<Option<&Person>, CanwuError>
pub fn government( &self, id: GovernmentId, ) -> Result<Option<&Government>, CanwuError>
pub fn territory( &self, id: TerritoryId, ) -> Result<Option<&Territory>, CanwuError>
pub fn route(&self, id: RouteId) -> Result<Option<&Route>, CanwuError>
pub fn actor_knowledge( &self, actor: PersonId, ) -> Result<Option<&ActorKnowledge>, CanwuError>
Sourcepub fn knowledge_records(
&self,
holder: KnowledgeHolderRef,
query: &KnowledgeQuery,
) -> Result<KnowledgeQueryResult, CanwuError>
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.
Sourcepub fn command(
&self,
id: CommandId,
) -> Result<Option<&CommandRecord>, CanwuError>
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.
Sourcepub fn event(&self, id: EventId) -> Result<Option<&SimEvent>, CanwuError>
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.
pub fn ingress( &self, id: IngressId, ) -> Result<Option<&IngressRecord>, CanwuError>
pub fn domain_record( &self, reference: &DomainRecordRef, ) -> Result<Option<&DomainRecord>, CanwuError>
pub fn typed_domain_record<T: DomainRecordType>( &self, reference: &TypedDomainRecordRef<T>, ) -> Result<Option<&DomainRecord>, CanwuError>
pub fn proposed_domain_record( &self, reference: &DomainRecordRef, ) -> Result<Option<&DomainRecord>, CanwuError>
pub fn proposed_typed_domain_record<T: DomainRecordType>( &self, reference: &TypedDomainRecordRef<T>, ) -> Result<Option<&DomainRecord>, CanwuError>
Sourcepub fn proposed_domain_record_version(
&self,
reference: &DomainRecordRef,
) -> Result<Option<DomainRecordVersionRef>, CanwuError>
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.
Sourcepub fn domain_record_version_evidence_exists(
&self,
reference: &DomainRecordVersionRef,
) -> Result<bool, CanwuError>
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.
Sourcepub fn domain_records_of_kind(
&self,
kind: &DomainRecordKind,
limit: usize,
) -> Result<Vec<DomainRecord>, CanwuError>
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.
Sourcepub fn domain_records_of_kind_after(
&self,
kind: &DomainRecordKind,
after: Option<&DomainRecordRef>,
limit: usize,
) -> Result<Vec<DomainRecord>, CanwuError>
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.
Sourcepub fn knowledge_changes_by_correlation(
&self,
plugin: &str,
producer_correlation: &str,
) -> Result<Vec<BoundaryKnowledgeChange>, CanwuError>
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.
Sourcepub fn knowledge_changes_by_correlation_prefix(
&self,
plugin: &str,
producer_correlation_prefix: &str,
) -> Result<Vec<BoundaryKnowledgeChange>, CanwuError>
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.