pub struct GrainRecord {
pub hash: String,
pub grain_type: String,
pub namespace: String,
pub created_at_ms: i64,
pub valid_to_ms: Option<i64>,
pub superseded_by: Option<String>,
pub fields: Map<String, Value>,
}Expand description
A grain as read from the substrate: the content address, the OMS type name,
index-layer facts (superseded_by), and the decoded field map. The engine
treats fields as JSON and pulls typed values through the accessors below.
Fields§
§hash: String§grain_type: String§namespace: String§created_at_ms: i64§valid_to_ms: Option<i64>§superseded_by: Option<String>Index-layer supersession pointer; Some means this grain is not a head.
fields: Map<String, Value>Implementations§
Source§impl GrainRecord
impl GrainRecord
pub fn str_field(&self, key: &str) -> Option<&str>
pub fn bool_field(&self, key: &str) -> Option<bool>
pub fn fact_subject(&self) -> Option<&str>
pub fn fact_relation(&self) -> Option<&str>
pub fn fact_object(&self) -> Option<&str>
pub fn tool_name(&self) -> Option<&str>
pub fn is_error(&self) -> bool
Sourcepub fn tool_content(&self) -> Option<&str>
pub fn tool_content(&self) -> Option<&str>
The tool result text used for error-signature extraction. Tool grains
carry it as tool_content (compact cnt, distinct from Event’s
uncompacted content); other shapes fall back.
pub fn skill_name(&self) -> Option<&str>
Sourcepub fn skill_proficiency(&self) -> Option<f64>
pub fn skill_proficiency(&self) -> Option<f64>
Skill proficiency (dedicated proficiency key; aliases confidence).
pub fn skill_practice_count(&self) -> i64
pub fn goal_state(&self) -> Option<&str>
pub fn goal_progress(&self) -> f64
Trait Implementations§
Source§impl Clone for GrainRecord
impl Clone for GrainRecord
Source§impl Debug for GrainRecord
impl Debug for GrainRecord
Source§impl<'de> Deserialize<'de> for GrainRecord
impl<'de> Deserialize<'de> for GrainRecord
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 GrainRecord
impl PartialEq for GrainRecord
Source§impl Serialize for GrainRecord
impl Serialize for GrainRecord
impl StructuralPartialEq for GrainRecord
Auto Trait Implementations§
impl Freeze for GrainRecord
impl RefUnwindSafe for GrainRecord
impl Send for GrainRecord
impl Sync for GrainRecord
impl Unpin for GrainRecord
impl UnsafeUnpin for GrainRecord
impl UnwindSafe for GrainRecord
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