pub trait Record<B: Backend>: Send {
type Item<S: PrecisionSettings>: Serialize + DeserializeOwned + Clone;
// Required methods
fn into_item<S: PrecisionSettings>(self) -> Self::Item<S>;
fn from_item<S: PrecisionSettings>(
item: Self::Item<S>,
device: &B::Device,
) -> Self;
}Expand description
Trait to define a family of types which can be recorded using any settings.
Required Associated Types§
Sourcetype Item<S: PrecisionSettings>: Serialize + DeserializeOwned + Clone
type Item<S: PrecisionSettings>: Serialize + DeserializeOwned + Clone
Type of the item that can be serialized and deserialized.
Required Methods§
Sourcefn into_item<S: PrecisionSettings>(self) -> Self::Item<S>
fn into_item<S: PrecisionSettings>(self) -> Self::Item<S>
Convert the current record into the corresponding item that follows the given settings.
Sourcefn from_item<S: PrecisionSettings>(
item: Self::Item<S>,
device: &B::Device,
) -> Self
fn from_item<S: PrecisionSettings>( item: Self::Item<S>, device: &B::Device, ) -> Self
Convert the given item into a record.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<B, R0, R1, R2, R3, R4, R5, R6, R7, R8, R9> Record<B> for (R0, R1, R2, R3, R4, R5, R6, R7, R8, R9)
impl<B, R0, R1, R2, R3, R4, R5, R6, R7, R8, R9> Record<B> for (R0, R1, R2, R3, R4, R5, R6, R7, R8, R9)
type Item<S: PrecisionSettings> = (<R0 as Record<B>>::Item<S>, <R1 as Record<B>>::Item<S>, <R2 as Record<B>>::Item<S>, <R3 as Record<B>>::Item<S>, <R4 as Record<B>>::Item<S>, <R5 as Record<B>>::Item<S>, <R6 as Record<B>>::Item<S>, <R7 as Record<B>>::Item<S>, <R8 as Record<B>>::Item<S>, <R9 as Record<B>>::Item<S>)
fn into_item<S: PrecisionSettings>(self) -> Self::Item<S>
fn from_item<S: PrecisionSettings>( item: Self::Item<S>, device: &B::Device, ) -> Self
Source§impl<B, R0, R1, R2, R3, R4, R5, R6, R7, R8> Record<B> for (R0, R1, R2, R3, R4, R5, R6, R7, R8)
impl<B, R0, R1, R2, R3, R4, R5, R6, R7, R8> Record<B> for (R0, R1, R2, R3, R4, R5, R6, R7, R8)
type Item<S: PrecisionSettings> = (<R0 as Record<B>>::Item<S>, <R1 as Record<B>>::Item<S>, <R2 as Record<B>>::Item<S>, <R3 as Record<B>>::Item<S>, <R4 as Record<B>>::Item<S>, <R5 as Record<B>>::Item<S>, <R6 as Record<B>>::Item<S>, <R7 as Record<B>>::Item<S>, <R8 as Record<B>>::Item<S>)
fn into_item<S: PrecisionSettings>(self) -> Self::Item<S>
fn from_item<S: PrecisionSettings>( item: Self::Item<S>, device: &B::Device, ) -> Self
Source§impl<B, R0, R1, R2, R3, R4, R5, R6, R7> Record<B> for (R0, R1, R2, R3, R4, R5, R6, R7)
impl<B, R0, R1, R2, R3, R4, R5, R6, R7> Record<B> for (R0, R1, R2, R3, R4, R5, R6, R7)
type Item<S: PrecisionSettings> = (<R0 as Record<B>>::Item<S>, <R1 as Record<B>>::Item<S>, <R2 as Record<B>>::Item<S>, <R3 as Record<B>>::Item<S>, <R4 as Record<B>>::Item<S>, <R5 as Record<B>>::Item<S>, <R6 as Record<B>>::Item<S>, <R7 as Record<B>>::Item<S>)
fn into_item<S: PrecisionSettings>(self) -> Self::Item<S>
fn from_item<S: PrecisionSettings>( item: Self::Item<S>, device: &B::Device, ) -> Self
Source§impl<B, R0, R1, R2, R3, R4, R5, R6> Record<B> for (R0, R1, R2, R3, R4, R5, R6)
impl<B, R0, R1, R2, R3, R4, R5, R6> Record<B> for (R0, R1, R2, R3, R4, R5, R6)
type Item<S: PrecisionSettings> = (<R0 as Record<B>>::Item<S>, <R1 as Record<B>>::Item<S>, <R2 as Record<B>>::Item<S>, <R3 as Record<B>>::Item<S>, <R4 as Record<B>>::Item<S>, <R5 as Record<B>>::Item<S>, <R6 as Record<B>>::Item<S>)
fn into_item<S: PrecisionSettings>(self) -> Self::Item<S>
fn from_item<S: PrecisionSettings>( item: Self::Item<S>, device: &B::Device, ) -> Self
Source§impl<B, R0, R1, R2, R3, R4, R5> Record<B> for (R0, R1, R2, R3, R4, R5)
impl<B, R0, R1, R2, R3, R4, R5> Record<B> for (R0, R1, R2, R3, R4, R5)
type Item<S: PrecisionSettings> = (<R0 as Record<B>>::Item<S>, <R1 as Record<B>>::Item<S>, <R2 as Record<B>>::Item<S>, <R3 as Record<B>>::Item<S>, <R4 as Record<B>>::Item<S>, <R5 as Record<B>>::Item<S>)
fn into_item<S: PrecisionSettings>(self) -> Self::Item<S>
fn from_item<S: PrecisionSettings>( item: Self::Item<S>, device: &B::Device, ) -> Self
Source§impl<B, R0, R1, R2, R3, R4> Record<B> for (R0, R1, R2, R3, R4)
impl<B, R0, R1, R2, R3, R4> Record<B> for (R0, R1, R2, R3, R4)
type Item<S: PrecisionSettings> = (<R0 as Record<B>>::Item<S>, <R1 as Record<B>>::Item<S>, <R2 as Record<B>>::Item<S>, <R3 as Record<B>>::Item<S>, <R4 as Record<B>>::Item<S>)
fn into_item<S: PrecisionSettings>(self) -> Self::Item<S>
fn from_item<S: PrecisionSettings>( item: Self::Item<S>, device: &B::Device, ) -> Self
Source§impl<B, R0, R1, R2, R3> Record<B> for (R0, R1, R2, R3)
impl<B, R0, R1, R2, R3> Record<B> for (R0, R1, R2, R3)
type Item<S: PrecisionSettings> = (<R0 as Record<B>>::Item<S>, <R1 as Record<B>>::Item<S>, <R2 as Record<B>>::Item<S>, <R3 as Record<B>>::Item<S>)
fn into_item<S: PrecisionSettings>(self) -> Self::Item<S>
fn from_item<S: PrecisionSettings>( item: Self::Item<S>, device: &B::Device, ) -> Self
Source§impl<B, R0, R1, R2> Record<B> for (R0, R1, R2)
impl<B, R0, R1, R2> Record<B> for (R0, R1, R2)
Source§impl<const N: usize, T, B> Record<B> for [T; N]
impl<const N: usize, T, B> Record<B> for [T; N]
Source§type Item<S: PrecisionSettings> = Array<N, <T as Record<B>>::Item<S>>
type Item<S: PrecisionSettings> = Array<N, <T as Record<B>>::Item<S>>
The record item is an array of the record item of the elements. The reason why we wrap the array in a struct is because serde does not support deserializing arrays of variable size, see serde/issues/1937. for backward compatibility reasons. Serde APIs were created before const generics.