Skip to main content

InvariantReadContextExt

Trait InvariantReadContextExt 

Source
pub trait InvariantReadContextExt: BizInvariantReadContext {
    // Provided methods
    fn with_read_typed<R, T, F>(
        &self,
        sys_id: SysId,
        f: F,
    ) -> Result<Option<T>, RuntimeHostError>
       where R: GeneratedRecordAccess,
             F: FnOnce(R::Access<'_>) -> T { ... }
    fn with_read_typed_by_pk<R, P, T, F>(
        &self,
        pk: P,
        f: F,
    ) -> Result<Option<T>, RuntimeHostError>
       where R: GeneratedRecordAccess,
             P: AsRef<[u8]>,
             F: FnOnce(R::Access<'_>) -> T { ... }
}
Expand description

Typed convenience methods for BizInvariantReadContext.

Provided Methods§

Source

fn with_read_typed<R, T, F>( &self, sys_id: SysId, f: F, ) -> Result<Option<T>, RuntimeHostError>
where R: GeneratedRecordAccess, F: FnOnce(R::Access<'_>) -> T,

Reads a generated record by system id.

Source

fn with_read_typed_by_pk<R, P, T, F>( &self, pk: P, f: F, ) -> Result<Option<T>, RuntimeHostError>
where R: GeneratedRecordAccess, P: AsRef<[u8]>, F: FnOnce(R::Access<'_>) -> T,

Reads a generated record by primary key.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§