pub trait Recorder<B: Backend>: Send + Sync + Default + Debug + Clone {
type Settings: PrecisionSettings;
type RecordArgs: Clone;
type RecordOutput;
type LoadArgs: Clone;
// Required methods
fn save_item<I: Serialize>(
&self,
item: I,
args: Self::RecordArgs
) -> Result<Self::RecordOutput, RecorderError>;
fn load_item<I>(&self, args: 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: Self::LoadArgs) -> Result<I, RecorderError>where
I: DeserializeOwned,
fn load_item<I>(&self, args: 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>,
Object Safety§
This trait is not object safe.