pub struct SemanticUnit {
pub kind: String,
pub slots: BTreeMap<String, Value>,
pub source_hash: [u8; 32],
}Expand description
Minimal AST node representing a canonical semantic intent.
Fields§
§kind: StringKind of intent (e.g., “policy.allow”, “freeform.intent”).
slots: BTreeMap<String, Value>Named slots after resolution (normalized, deterministic order in canon).
source_hash: [u8; 32]Hash of the source text (not the canonical form). BLAKE3-32.
Implementations§
Source§impl SemanticUnit
impl SemanticUnit
Sourcepub fn from_intent(text: &str) -> Self
pub fn from_intent(text: &str) -> Self
Naive builder from raw input (normalize whitespace to single spaces).
Sourcepub fn canonical_bytes(&self) -> Vec<u8> ⓘ
pub fn canonical_bytes(&self) -> Vec<u8> ⓘ
Canonical JSON bytes via json_atomic — single source of truth.
Sourcepub fn cid_blake3(&self) -> [u8; 32]
pub fn cid_blake3(&self) -> [u8; 32]
CID of canonical bytes = BLAKE3-32.
Trait Implementations§
Source§impl Clone for SemanticUnit
impl Clone for SemanticUnit
Source§fn clone(&self) -> SemanticUnit
fn clone(&self) -> SemanticUnit
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticUnit
impl Debug for SemanticUnit
Source§impl<'de> Deserialize<'de> for SemanticUnit
impl<'de> Deserialize<'de> for SemanticUnit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SemanticUnit
impl PartialEq for SemanticUnit
Source§impl Serialize for SemanticUnit
impl Serialize for SemanticUnit
impl Eq for SemanticUnit
impl StructuralPartialEq for SemanticUnit
Auto Trait Implementations§
impl Freeze for SemanticUnit
impl RefUnwindSafe for SemanticUnit
impl Send for SemanticUnit
impl Sync for SemanticUnit
impl Unpin for SemanticUnit
impl UnwindSafe for SemanticUnit
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