pub trait Recorder<B: Backend>:
Send
+ Sync
+ Default
+ Debug
+ Clone {
type Settings: PrecisionSettings;
type RecordArgs: Clone;
type RecordOutput;
type LoadArgs;
// Required methods
fn save_item<I: Serialize>(
&self,
item: I,
args: Self::RecordArgs,
) -> Result<Self::RecordOutput, RecorderError>;
fn load_item<I>(
&self,
args: &mut Self::LoadArgs,
) -> Result<I, RecorderError>
where I: DeserializeOwned;
// Provided methods
fn record<R>(
&self,
record: R,
args: Self::RecordArgs,
) -> Result<Self::RecordOutput, RecorderError>
where R: Record<B> { ... }
fn load<R>(
&self,
args: Self::LoadArgs,
device: &B::Device,
) -> Result<R, RecorderError>
where R: Record<B> { ... }
}Expand description
Record any item implementing Serialize and DeserializeOwned.
Required Associated Types§
Sourcetype Settings: PrecisionSettings
type Settings: PrecisionSettings
Type of the settings used by the recorder.
Sourcetype RecordArgs: Clone
type RecordArgs: Clone
Arguments used to record objects.
Sourcetype RecordOutput
type RecordOutput
Record output type.
Required Methods§
Sourcefn save_item<I: Serialize>(
&self,
item: I,
args: Self::RecordArgs,
) -> Result<Self::RecordOutput, RecorderError>
fn save_item<I: Serialize>( &self, item: I, args: Self::RecordArgs, ) -> Result<Self::RecordOutput, RecorderError>
Sourcefn load_item<I>(&self, args: &mut Self::LoadArgs) -> Result<I, RecorderError>where
I: DeserializeOwned,
fn load_item<I>(&self, args: &mut Self::LoadArgs) -> Result<I, RecorderError>where
I: DeserializeOwned,
Provided Methods§
Sourcefn record<R>(
&self,
record: R,
args: Self::RecordArgs,
) -> Result<Self::RecordOutput, RecorderError>where
R: Record<B>,
fn record<R>(
&self,
record: R,
args: Self::RecordArgs,
) -> Result<Self::RecordOutput, RecorderError>where
R: Record<B>,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl<S: PrecisionSettings, B: Backend> Recorder<B> for BinFileRecorder<S>
Available on crate feature std only.
impl<S: PrecisionSettings, B: Backend> Recorder<B> for BinFileRecorder<S>
Available on crate feature
std only.Source§impl<S: PrecisionSettings, B: Backend> Recorder<B> for BinGzFileRecorder<S>
Available on crate feature std only.
impl<S: PrecisionSettings, B: Backend> Recorder<B> for BinGzFileRecorder<S>
Available on crate feature
std only.Source§impl<S: PrecisionSettings, B: Backend> Recorder<B> for JsonGzFileRecorder<S>
Available on crate feature std only.
impl<S: PrecisionSettings, B: Backend> Recorder<B> for JsonGzFileRecorder<S>
Available on crate feature
std only.Source§impl<S: PrecisionSettings, B: Backend> Recorder<B> for NamedMpkBytesRecorder<S>
Available on crate feature std only.
impl<S: PrecisionSettings, B: Backend> Recorder<B> for NamedMpkBytesRecorder<S>
Available on crate feature
std only.Source§impl<S: PrecisionSettings, B: Backend> Recorder<B> for NamedMpkFileRecorder<S>
Available on crate feature std only.
impl<S: PrecisionSettings, B: Backend> Recorder<B> for NamedMpkFileRecorder<S>
Available on crate feature
std only.Source§impl<S: PrecisionSettings, B: Backend> Recorder<B> for NamedMpkGzFileRecorder<S>
Available on crate feature std only.
impl<S: PrecisionSettings, B: Backend> Recorder<B> for NamedMpkGzFileRecorder<S>
Available on crate feature
std only.Source§impl<S: PrecisionSettings, B: Backend> Recorder<B> for PrettyJsonFileRecorder<S>
Available on crate feature std only.
impl<S: PrecisionSettings, B: Backend> Recorder<B> for PrettyJsonFileRecorder<S>
Available on crate feature
std only.