pub trait Recorder<B>:
Send
+ Sync
+ Default
+ Debug
+ Clonewhere
B: Backend,{
type Settings: PrecisionSettings;
type RecordArgs: Clone;
type RecordOutput;
type LoadArgs: Clone;
// Required methods
fn save_item<I>(
&self,
item: I,
args: Self::RecordArgs,
) -> Result<Self::RecordOutput, RecorderError>
where I: Serialize;
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 as Backend>::Device,
) -> Result<R, RecorderError>
where R: Record<B> { ... }
}
Expand description
Record any item implementing Serialize and DeserializeOwned.
Required Associated Types§
type Settings: PrecisionSettings
type Settings: PrecisionSettings
Type of the settings used by the recorder.
type RecordArgs: Clone
type RecordArgs: Clone
Arguments used to record objects.
type RecordOutput
type RecordOutput
Record output type.
Required Methods§
fn save_item<I>(
&self,
item: I,
args: Self::RecordArgs,
) -> Result<Self::RecordOutput, RecorderError>where
I: Serialize,
fn save_item<I>(
&self,
item: I,
args: Self::RecordArgs,
) -> Result<Self::RecordOutput, RecorderError>where
I: Serialize,
fn 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§
fn 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.