Skip to main content

Recorder

Struct Recorder 

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

Writes down what happened, one record per forward. It owns its store where a Cache borrows one: a cache is made for one forward and a recorder counts them.

Implementations§

Source§

impl Recorder

Source

pub fn over(store: Arc<dyn Store>) -> Self

A recorder over this store, under a name of its own — made here and readable with run, because a forward in a notebook has no reason to invent one and still has to be findable.

Source

pub fn named(store: Arc<dyn Store>, run: impl Into<String>) -> Self

The same, under a name you chose: a training run that wants to be found again by the name it already has.

Source

pub fn summarising( self, kinds: impl IntoIterator<Item = impl Into<String>>, ) -> Self

The same recorder, with these kinds of fact carried in the record and not only in the blob, as <kind>.<field>.

Ten thousand losses read one blob at a time is ten thousand round trips and the number wanted from each is one. Which kinds those are is the caller’s, so this crate does not learn what a loss is. The last fact of each kind in a forward is the one carried.

Source

pub fn run(&self) -> &str

What this run is called, which is the first half of every name it writes.

Source

pub fn said(&self, kind: &str, fields: Vec<(String, String)>)

One fact from a vocabulary that is not the engine’s. It lands in the forward in flight, or — the normal case for a loss — in the one that ended last, whose record is rewritten. The fields are text to text because that is what a record is; the vocabulary is the caller’s.

Trait Implementations§

Source§

impl Watcher for Recorder

Source§

fn saw(&self, fact: &Fact)

One fact. Whatever this does, it does not fail: there is no useful answer to “the log could not be written” in the middle of a run, and a Result here would make every emit site a decision about somebody else’s storage.

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

Source§

type Output = T

Should always be Self
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.