Skip to main content

Envelope

Struct Envelope 

Source
pub struct Envelope<'a> {
    pub count: usize,
    pub exhausted: bool,
    pub solutions: &'a [RenderedSolution],
    pub program_output: Option<&'a str>,
    pub atoms: Option<&'a [String]>,
}
Expand description

The fixed engine-output shape — the contract, made a type. Every encoding reads the same fields; only their byte encoding varies.

Fields§

§count: usize§exhausted: bool§solutions: &'a [RenderedSolution]§program_output: Option<&'a str>

Captured write/1 bytes, when the sink is in capture mode. None when output streamed to stdout (the CLI text path). Encodings that can’t stream require the caller to have run in capture mode so this is Some.

§atoms: Option<&'a [String]>

The atom map (id → name, id = array index), when the bson output is self-describing (--atoms). Lets a host decode bson term values (atom- id-keyed TermBuf) from the single document — no external atom source. Emitted post-query, so it covers query-introduced atoms too.

Implementations§

Source§

impl<'a> Envelope<'a>

Source

pub fn from_machine(m: &'a Machine, exhausted: bool) -> Self

Build from the machine’s solved state. program_output follows the machine’s output sink: None when streaming to stdout, Some(..) when capturing — so one constructor serves both the CLI and the reactor.

Auto Trait Implementations§

§

impl<'a> Freeze for Envelope<'a>

§

impl<'a> RefUnwindSafe for Envelope<'a>

§

impl<'a> Send for Envelope<'a>

§

impl<'a> Sync for Envelope<'a>

§

impl<'a> Unpin for Envelope<'a>

§

impl<'a> UnsafeUnpin for Envelope<'a>

§

impl<'a> UnwindSafe for Envelope<'a>

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.