pub trait BizInvariantReadContext {
// Required methods
fn with_read_typed_raw(
&self,
record_kind: RecordKind,
sys_id: SysId,
f: &mut dyn FnMut(&[u8]),
) -> Result<bool, RuntimeHostError>;
fn with_read_typed_by_pk_raw(
&self,
record_kind: RecordKind,
pk: &[u8],
f: &mut dyn FnMut(&[u8]),
) -> Result<bool, RuntimeHostError>;
fn for_each_record_key_raw(
&self,
kind: RecordKind,
f: &mut dyn FnMut(RecordKey),
) -> Result<(), RuntimeHostError>;
}Expand description
Read-only state access surface for invariant validation.
This is the read-only subset of RuntimeHostContext, provided to
RuntimePlugin::validate_biz_invariants so that domain-specific business
invariants can be checked without mutating state.
Required Methods§
Sourcefn with_read_typed_raw(
&self,
record_kind: RecordKind,
sys_id: SysId,
f: &mut dyn FnMut(&[u8]),
) -> Result<bool, RuntimeHostError>
fn with_read_typed_raw( &self, record_kind: RecordKind, sys_id: SysId, f: &mut dyn FnMut(&[u8]), ) -> Result<bool, RuntimeHostError>
Reads a record by system id and passes its bytes to f when found.
Sourcefn with_read_typed_by_pk_raw(
&self,
record_kind: RecordKind,
pk: &[u8],
f: &mut dyn FnMut(&[u8]),
) -> Result<bool, RuntimeHostError>
fn with_read_typed_by_pk_raw( &self, record_kind: RecordKind, pk: &[u8], f: &mut dyn FnMut(&[u8]), ) -> Result<bool, RuntimeHostError>
Reads a record by primary-key bytes and passes its bytes to f when found.
Sourcefn for_each_record_key_raw(
&self,
kind: RecordKind,
f: &mut dyn FnMut(RecordKey),
) -> Result<(), RuntimeHostError>
fn for_each_record_key_raw( &self, kind: RecordKind, f: &mut dyn FnMut(RecordKey), ) -> Result<(), RuntimeHostError>
Iterates visible record keys for one record kind.