Skip to main content

CalResultPayload

Enum CalResultPayload 

Source
pub enum CalResultPayload {
Show 39 variants Grains { grains: Vec<CalGrainResult>, total_available: Option<usize>, }, Exists { exists: bool, hash: String, }, Count { count: usize, }, Granted { principal: String, object: String, hash: String, }, Revoked { principal: String, grants_touched: usize, }, GrantList { grants: Vec<Value>, }, LoopRan { run: Value, }, Reviewed { hash: String, decision: String, }, RecApplied { hash: String, rollbackable: bool, }, RecRolledBack { hash: String, }, Remembered { hash: String, }, EntityAt { grain: Option<Value>, axis: String, at_ms: i64, }, RunTrace { run_id: String, trace: Value, }, RunsTouching { hash: String, runs: Vec<String>, }, DerivedFrom { hash: String, grains: Vec<Value>, }, Forks { forks: Vec<Value>, }, Merged { hash: String, subject: String, relation: String, object: String, }, RelatedEntities { start: String, entities: Vec<String>, }, NoveltyMatches { matches: Vec<Value>, }, History { versions: Vec<CalVersionResult>, }, Describe { info: Value, }, Explain { plan: CalQueryPlan, }, Batch { results: HashMap<String, CalResultPayload>, }, Assembled { grains: Vec<CalGrainResult>, sources: Vec<SourceMeta>, total_tokens: u32, budget_limit: Option<u32>, progressive: bool, total_available: Option<usize>, }, Diff { source_hash: String, target_hash: String, changes: Vec<FieldDiff>, }, Formatted { text: String, format: String, grain_count: usize, grains: Vec<CalGrainResult>, }, MultiFormatted { formats: HashMap<String, String>, grain_count: usize, grains: Vec<CalGrainResult>, }, Added { hash: String, grain_type: String, extracted_count: Option<usize>, extraction_warnings: Vec<String>, }, Superseded { old_hash: String, new_hash: String, }, Accumulated { old_hash: String, new_hash: String, deltas: Vec<AccumulatedDelta>, }, TemplateDefined { name: String, }, TemplateDropped { name: String, }, QueryDefined { name: String, }, QueryDropped { name: String, }, StreamAssemble { assemble: Box<AssembleStmt>, with_options: Vec<WithOption>, }, Forgotten { target: String, count: u64, }, Purged { count: usize, }, SubjectReport { subject: String, identity_names: Vec<String>, grains: Vec<Value>, }, Unsupported { statement: String, message: String, },
}
Expand description

The result payload, discriminated by statement type.

Variants§

§

Grains

Result of RECALL, SET, or ASSEMBLE operations.

Fields

§total_available: Option<usize>

Total results available before pipeline LIMIT/OFFSET (best-effort).

§

Exists

Result of EXISTS.

Fields

§exists: bool
§hash: String
§

Count

Result of a | COUNT pipeline stage.

Fields

§count: usize
§

Granted

Result of GRANT (CAL 1.3 §8.15).

Fields

§principal: String
§object: String
§hash: String
§

Revoked

Result of REVOKE.

Fields

§principal: String
§grants_touched: usize
§

GrantList

Result of SHOW GRANTS — one row per live grant grain.

Fields

§grants: Vec<Value>
§

LoopRan

Result of RUN LOOP (CAL 1.3 §8.16) — the engine’s run report.

Fields

§run: Value
§

Reviewed

Result of APPROVE/REJECT.

Fields

§hash: String
§decision: String
§

RecApplied

Result of APPLY.

Fields

§hash: String
§rollbackable: bool
§

RecRolledBack

Result of ROLLBACK.

Fields

§hash: String
§

Remembered

Result of REMEMBER — the captured Event’s hash.

Fields

§hash: String
§

EntityAt

Result of ENTITY … AT — the as-of grain, or null.

Fields

§grain: Option<Value>
§axis: String
§at_ms: i64
§

RunTrace

Result of RUN TRACE — what a run recorded and produced.

Fields

§run_id: String
§trace: Value
§

RunsTouching

Result of RUNS TOUCHING — run ids, most recent first.

Fields

§hash: String
§runs: Vec<String>
§

DerivedFrom

Result of DERIVED FROM — reverse provenance rows.

Fields

§hash: String
§grains: Vec<Value>
§

Forks

Result of SHOW FORKS — the open forks.

Fields

§forks: Vec<Value>
§

Merged

Result of MERGE — the resolved head.

Fields

§hash: String
§subject: String
§relation: String
§object: String
§

RelatedEntities

Result of RELATED — the reachable entities.

Fields

§start: String
§entities: Vec<String>
§

NoveltyMatches

Result of NOVELTY — nearest matches, most similar first.

Fields

§matches: Vec<Value>
§

History

Result of HISTORY OF.

Fields

§

Describe

Result of DESCRIBE.

Fields

§info: Value
§

Explain

Result of EXPLAIN.

Fields

§

Batch

Result of BATCH.

§

Assembled

Result of a multi-source ASSEMBLE (Phase 2).

Fields

§grains: Vec<CalGrainResult>

Assembled grains after budget and dedup processing.

§sources: Vec<SourceMeta>

Per-source metadata.

§total_tokens: u32

Total tokens used across all sources.

§budget_limit: Option<u32>

Budget limit (if specified).

§progressive: bool

Always false (progressive_disclosure has been removed).

§total_available: Option<usize>

Total grains available before trimming.

§

Diff

Result of HISTORY <hash> DIFF <hash> — field-level differences.

Fields

§source_hash: String

Content-address hash of the source grain.

§target_hash: String

Content-address hash of the target grain.

§changes: Vec<FieldDiff>

Field-level differences between source and target.

§

Formatted

Result of single-format rendering (WI-1.1). Contains the rendered text and format name. Used when ASSEMBLE or RECALL has a single FORMAT clause.

Fields

§text: String

Rendered text output.

§format: String

Format name (e.g. “json”, “markdown”, “sml”).

§grain_count: usize

Number of grains that were formatted.

§grains: Vec<CalGrainResult>

Raw grains for A2UI surface building (not serialized on the wire).

§

MultiFormatted

Result of multi-format rendering (CAL spec v1.0.1, Section 14.2.1). Contains multiple renderings keyed by format name.

Fields

§formats: HashMap<String, String>

Renderings keyed by format name (e.g. “markdown” -> “…”, “json” -> “…”).

§grain_count: usize

Number of grains that were formatted.

§grains: Vec<CalGrainResult>

Raw grains for A2UI surface building (not serialized on the wire).

§

Added

Result of ADD (Tier 1).

Fields

§hash: String
§grain_type: String
§extracted_count: Option<usize>

Number of facts extracted (when WITH extract_memories was used).

§extraction_warnings: Vec<String>

Warnings from the extraction pipeline.

§

Superseded

Result of SUPERSEDE (Tier 1).

Fields

§old_hash: String
§new_hash: String
§

Accumulated

Result of ACCUMULATE (Tier 1).

Fields

§old_hash: String
§new_hash: String
§

TemplateDefined

Result of DEFINE TEMPLATE (FR-003).

Fields

§name: String
§

TemplateDropped

Result of DROP TEMPLATE (FR-003).

Fields

§name: String
§

QueryDefined

Result of DEFINE QUERY.

Fields

§name: String
§

QueryDropped

Result of DROP QUERY.

Fields

§name: String
§

StreamAssemble

Returned for STREAM ASSEMBLE — signals the HTTP handler to use SSE (FR-004).

Fields

§assemble: Box<AssembleStmt>

The parsed assemble statement (to be executed by the streaming handler).

§with_options: Vec<WithOption>

Query-level WITH options to apply post-merge (rerank, dedup, etc.).

§

Forgotten

Result of FORGET <hash>, FORGET USER, or FORGET SCOPE (Tier 2).

Fields

§target: String
§count: u64
§

Purged

Result of PURGE STALE (Tier 2).

Fields

§count: usize
§

SubjectReport

Result of REPORT SUBJECT — the read-only DSAR selection: the matched identity strings and grains ({hash, type, fields}).

Fields

§subject: String
§identity_names: Vec<String>
§grains: Vec<Value>
§

Unsupported

Returned for Tier 1/2 statements (S-2) or genuinely unsupported paths.

Fields

§statement: String
§message: String

Trait Implementations§

Source§

impl Debug for CalResultPayload

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for CalResultPayload

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Fruit for T
where T: Send + Downcast,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more