pub struct LispRenderer<'a> { /* private fields */ }Expand description
Renders memory records as Lisp S-expressions using a SymbolTable
to resolve SymbolId → canonical name. Output conforms to
ir-write-surface.md and re-parses to an equivalent
UnboundForm (modulo librarian-assigned memory_id /
committed_at / observed_at fields which the agent never
provides).
Implementations§
Source§impl<'a> LispRenderer<'a>
impl<'a> LispRenderer<'a>
Sourcepub fn new(table: &'a SymbolTable) -> Self
pub fn new(table: &'a SymbolTable) -> Self
Construct a renderer bound to a symbol table. The table must
resolve every SymbolId the renderer is asked to handle — use
mimir_core::Store::open to populate it from a canonical log.
Sourcepub fn render_memory(
&self,
record: &CanonicalRecord,
) -> Result<String, RenderError>
pub fn render_memory( &self, record: &CanonicalRecord, ) -> Result<String, RenderError>
Render a memory record as a Lisp S-expression. Non-memory
records (Checkpoint, SymbolAlloc, edge records) return
RenderError::NotAMemory so the caller can skip them.
§Errors
RenderError::NotAMemoryfor non-memory opcodes.RenderError::UnknownSymbolfor symbol IDs not in the table.
Auto Trait Implementations§
impl<'a> Freeze for LispRenderer<'a>
impl<'a> RefUnwindSafe for LispRenderer<'a>
impl<'a> Send for LispRenderer<'a>
impl<'a> Sync for LispRenderer<'a>
impl<'a> Unpin for LispRenderer<'a>
impl<'a> UnsafeUnpin for LispRenderer<'a>
impl<'a> UnwindSafe for LispRenderer<'a>
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