Struct NullRecorder

Source
pub struct NullRecorder<E, R>
where E: Env, R: ReplayBufferBase,
{ /* private fields */ }
Expand description

A recorder that discards all records without storing them.

The NullRecorder implements the Recorder trait but ignores all records passed to it. This is useful in several scenarios:

  • During debugging when you want to disable logging temporarily
  • In testing environments where record storage is not needed
  • When you want to measure performance without the overhead of record storage
  • As a placeholder when record storage is optional

§Type Parameters

  • E - The environment type that implements the Env trait
  • R - The replay buffer type that implements the ReplayBufferBase trait

Implementations§

Source§

impl<E, R> NullRecorder<E, R>
where E: Env, R: ReplayBufferBase,

Source

pub fn new() -> Self

Creates a new null recorder.

§Returns

A new instance of NullRecorder that will discard all records.

Trait Implementations§

Source§

impl<E, R> Recorder<E, R> for NullRecorder<E, R>
where E: Env, R: ReplayBufferBase,

Source§

fn write(&mut self, _record: Record)

Discards the given record without storing it.

This method is a no-op and immediately discards the record.

§Arguments
  • _record - The record to be discarded
Source§

fn store(&mut self, _record: Record)

Discards the given record without storing it.

This method is a no-op and immediately discards the record.

§Arguments
  • _record - The record to be discarded
Source§

fn flush(&mut self, _step: i64)

No-op flush operation.

This method does nothing as no records are stored.

§Arguments
  • _step - The step at which to flush (ignored)
Source§

fn save_model(&self, base: &Path, agent: &Box<dyn Agent<E, R>>) -> Result<()>

Saves the current state of the agent’s model. Read more
Source§

fn load_model( &self, base: &Path, agent: &mut Box<dyn Agent<E, R>>, ) -> Result<()>

Loads a previously saved model state into the agent. Read more

Auto Trait Implementations§

§

impl<E, R> Freeze for NullRecorder<E, R>

§

impl<E, R> RefUnwindSafe for NullRecorder<E, R>

§

impl<E, R> Send for NullRecorder<E, R>
where E: Send, R: Send,

§

impl<E, R> Sync for NullRecorder<E, R>
where E: Sync, R: Sync,

§

impl<E, R> Unpin for NullRecorder<E, R>
where E: Unpin, R: Unpin,

§

impl<E, R> UnwindSafe for NullRecorder<E, R>
where E: UnwindSafe, R: UnwindSafe,

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.
Source§

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

Source§

fn vzip(self) -> V