chore: add Clone as Trait requirement for EAV
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
use heave::*;
|
use heave::*;
|
||||||
|
|
||||||
// Define a struct named `Product` to represent a product.
|
// Define a struct named `Product` to represent a product.
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq, Clone)]
|
||||||
struct Product {
|
struct Product {
|
||||||
// `id` is a public field of type `String` to uniquely identify the product.
|
// `id` is a public field of type `String` to uniquely identify the product.
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
use heave::*;
|
use heave::*;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq, Clone)]
|
||||||
struct Laptop {
|
struct Laptop {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
pub model: String,
|
pub model: String,
|
||||||
pub price: u64,
|
pub price: u64,
|
||||||
}
|
}
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq, Clone)]
|
||||||
struct Display {
|
struct Display {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
pub model: String,
|
pub model: String,
|
||||||
pub resolution: f64,
|
pub resolution: f64,
|
||||||
pub price: u64,
|
pub price: u64,
|
||||||
}
|
}
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq, Clone)]
|
||||||
struct Mouse {
|
struct Mouse {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
pub model: String,
|
pub model: String,
|
||||||
pub wireless: bool,
|
pub wireless: bool,
|
||||||
pub price: u64,
|
pub price: u64,
|
||||||
}
|
}
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq, Clone)]
|
||||||
enum Product {
|
enum Product {
|
||||||
None,
|
None,
|
||||||
Laptop(Laptop),
|
Laptop(Laptop),
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ pub trait T where
|
|||||||
Self: TryFrom<Entity>,
|
Self: TryFrom<Entity>,
|
||||||
Self: TryInto<Entity>,
|
Self: TryInto<Entity>,
|
||||||
Self: PartialEq,
|
Self: PartialEq,
|
||||||
|
Self: Clone,
|
||||||
{
|
{
|
||||||
/// Returns the class name of the type.
|
/// Returns the class name of the type.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user