pub struct AdamCheckingEnvironment { /* private fields */ }Expand description
Owns CEL checking facts and explicit Adam-registered storage leaves.
Membership IDs belong to the inner CEL catalog, are unique, and are sorted. CEL capabilities and type-function results never imply Adam membership.
§Examples
let environment = adam_lang::checking_environment(
&adam_lang::TypeRegistry::new(), &cel_parser::OpLookup::new()).unwrap();
assert!(environment.cel().resolve_type("i32").is_some());
assert!(!environment.cell_types().is_empty());Implementations§
Source§impl AdamCheckingEnvironment
impl AdamCheckingEnvironment
Sourcepub fn from_parts(
cel: CheckingEnvironment,
cell_types: Vec<u32>,
) -> Result<Self, MetadataError>
pub fn from_parts( cel: CheckingEnvironment, cell_types: Vec<u32>, ) -> Result<Self, MetadataError>
Owns the catalog and sorts explicitly supplied Adam leaf membership.
§Errors
Rejects duplicate IDs and IDs absent from the CEL catalog.
- Complexity: Expected O(n + m log(m + 1)) time and O(n + m) space for n catalog leaves and m membership IDs, including owned membership storage.
§Examples
use adam_lang::checking::AdamCheckingEnvironment;
let cel = cel_parser::checking::CheckingBuilder::new().finish().unwrap();
let environment = AdamCheckingEnvironment::from_parts(cel, vec![]).unwrap();
assert!(environment.cell_types().is_empty());Sourcepub fn cel(&self) -> &CheckingEnvironment
pub fn cel(&self) -> &CheckingEnvironment
Borrows the CEL catalog used by expression checks and native bindings.
§Examples
See the type example.
Sourcepub fn cell_types(&self) -> &[u32]
pub fn cell_types(&self) -> &[u32]
Auto Trait Implementations§
impl Freeze for AdamCheckingEnvironment
impl RefUnwindSafe for AdamCheckingEnvironment
impl Send for AdamCheckingEnvironment
impl Sync for AdamCheckingEnvironment
impl Unpin for AdamCheckingEnvironment
impl UnsafeUnpin for AdamCheckingEnvironment
impl UnwindSafe for AdamCheckingEnvironment
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more