Adding conditions for serialize_vec_from_table*
This commit is contained in:
parent
45c31c23b4
commit
27a9f1cb5c
|
|
@ -33,13 +33,13 @@ impl EquipementDatabase {
|
|||
}
|
||||
|
||||
impl RecipeDatabase for EquipementDatabase {
|
||||
fn serialize_vec_from_table<T>(
|
||||
fn serialize_vec_from_table<T: DeserializeOwned>(
|
||||
table: &str,
|
||||
) -> Result<Vec<T>, crate::error::FatalEquipementError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn serialize_vec_from_table_with_query<T>(
|
||||
fn serialize_vec_from_table_with_query<T: DeserializeOwned>(
|
||||
table: &str,
|
||||
query: &str,
|
||||
) -> Result<Vec<T>, crate::error::FatalEquipementError> {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
use std::{path::Path, rc::Rc};
|
||||
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
use crate::error::{EquipementError, FatalEquipementError};
|
||||
|
||||
/// Trait representing a view table
|
||||
|
|
@ -162,12 +164,12 @@ pub trait RecipeDatabase {
|
|||
Self: std::marker::Sized;
|
||||
|
||||
/// Serialize a vector of objects of the given type in the specified table of the underlying database
|
||||
fn serialize_vec_from_table<T>(
|
||||
fn serialize_vec_from_table<T: DeserializeOwned>(
|
||||
table: &str,
|
||||
) -> std::result::Result<Vec<T>, FatalEquipementError>;
|
||||
|
||||
/// Serialize a specified vector of objects of the given type with an additionnal restriction
|
||||
fn serialize_vec_from_table_with_query<T>(
|
||||
fn serialize_vec_from_table_with_query<T: DeserializeOwned>(
|
||||
table: &str,
|
||||
query: &str,
|
||||
) -> std::result::Result<Vec<T>, FatalEquipementError>;
|
||||
|
|
|
|||
Loading…
Reference in New Issue