Skip to main content

Store

Struct Store 

Source
pub struct Store { /* private fields */ }
Expand description

The persistent store.

Implementations§

Source§

impl Store

Source

pub fn new(hashcons: bool) -> Self

A new store. hashcons: false is the -hashcons ablation: every intern inserts a fresh node, and equality must be structural.

Source

pub fn with_string_order(hashcons: bool, order: StringOrder) -> Self

A new store whose strings compare in order (--compat=tlc uses StringOrder::Token). The order is fixed for the store’s life, because sets are kept sorted in it.

Source

pub fn with_semantics(hashcons: bool, semantics: Semantics) -> Self

A new store with the run’s value semantics, so that constant folding, the search and trace replay all compute alike.

Source

pub fn set_printer(&self, printer: Printer)

Sets the model’s name table and value semantics, which printing (ToString, Print) converts values with (print.rs). The first call wins.

Source

pub fn note_lazy_sets(&self)

Records that the plan may build a value TLC keeps as an interval or a lazy set (a..b, DOMAIN, SUBSET, [S -> T], [a : S], S \X T), which the core may enumerate: printing then refuses the enumerated sets TLC could print otherwise (print.rs). Set while compiling, before any search.

Source

pub fn lazy_sets(&self) -> bool

Whether Store::note_lazy_sets was called.

Source

pub fn set_draws(&self, draws: Arc<dyn Draws>)

Sets the run’s random streams (RandomElement). The first call wins.

Source

pub fn draws(&self) -> Option<&Arc<dyn Draws>>

The run’s random streams, once set.

Source

pub fn set_registers(&self, registers: Arc<dyn Registers>)

Sets the run’s TLCSet/TLCGet registers. The first call wins.

Source

pub fn registers(&self) -> Option<&Arc<dyn Registers>>

The run’s registers, once set.

Source

pub fn printer(&self) -> Option<&Printer>

The printer, once set.

Source

pub fn hashcons(&self) -> bool

Whether values are hash-consed.

Source

pub fn semantics(&self) -> Semantics

The run’s value semantics.

Source

pub fn int_mode(&self) -> IntMode

The integer semantics heaps on this store start with.

Source

pub fn strings(&self) -> &Strings

The string table.

Source

pub fn poisoned(&self) -> bool

Whether a read used a handle the store never issued (a bug).

Source

pub fn stats(&self) -> StoreStats

Intern statistics, summed over the shards.

Source

pub fn memory_usage(&self) -> StoreMemory

Measures known requested retained bytes and capacities, including tables still held by readers after index growth. Dead retirement records are collected before reporting; their vector’s spare capacity still counts.

This read takes shard locks, without changing interning identities or hit/miss counters. It is intended for phase boundaries, not the hot path. See StoreMemory for opaque allocations and snapshot limitations.

let store = dive_core::Store::default();
let memory = store.memory_usage();
assert!(memory.fixed_bytes > 0);
assert_eq!(memory.slab_bytes, 0);
assert!(memory.known_retained_bytes().is_some());

Trait Implementations§

Source§

impl Debug for Store

Source§

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

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

impl Default for Store

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for Store

§

impl !RefUnwindSafe for Store

§

impl !UnwindSafe for Store

§

impl Forget for Store

§

impl Move for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

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 = !

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.