Trait diesel_derives_traits::Model [−][src]
pub trait Model<'a, C> where
&'a Self: Identifiable,
C: Connection,
Self: Sized + 'a, { fn save(self, conn: &C) -> QueryResult<Self>; fn find_all(conn: &C) -> QueryResult<Vec<Self>>; fn find_one(
conn: &C,
id: <&'a Self as Identifiable>::Id
) -> QueryResult<Option<Self>>; fn exists(conn: &C, id: <&'a Self as Identifiable>::Id) -> QueryResult<bool>; fn count_all(conn: &C) -> QueryResult<i64>; fn destroy(self, conn: &C) -> QueryResult<()>; }
Required methods
fn save(self, conn: &C) -> QueryResult<Self>
[src]
fn find_all(conn: &C) -> QueryResult<Vec<Self>>
[src]
fn find_one(
conn: &C,
id: <&'a Self as Identifiable>::Id
) -> QueryResult<Option<Self>>
[src]
conn: &C,
id: <&'a Self as Identifiable>::Id
) -> QueryResult<Option<Self>>