[][src]Trait rpa::Rpa

pub trait Rpa<T, C> where
    C: Connection, 
{ fn into_json(self) -> Json<T>;
fn from_json(json: Json<T>) -> T;
fn save(entity: &T, connection: &C) -> Result<T, RpaError>;
fn save_self(self, connection: &C) -> Result<T, RpaError>;
fn find(entity_id: &String, connection: &C) -> Result<T, RpaError>;
fn find_all(connection: &C) -> Result<Vec<T>, RpaError>;
fn exists(entity_id: &String, connection: &C) -> Result<bool, RpaError>;
fn update(
        entity_id: &String,
        entity: &T,
        connection: &C
    ) -> Result<usize, RpaError>;
fn update_self(self, connection: &C) -> Result<usize, RpaError>;
fn delete(entity_id: &String, connection: &C) -> Result<usize, RpaError>;
fn delete_self(self, connection: &C) -> Result<usize, RpaError>; }

Rpa (Rust Persistence API) Library Copyright (C) 2019 Jonathan Franco, Hebert Vera

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Required methods

fn into_json(self) -> Json<T>

fn from_json(json: Json<T>) -> T

fn save(entity: &T, connection: &C) -> Result<T, RpaError>

fn save_self(self, connection: &C) -> Result<T, RpaError>

fn find(entity_id: &String, connection: &C) -> Result<T, RpaError>

fn find_all(connection: &C) -> Result<Vec<T>, RpaError>

fn exists(entity_id: &String, connection: &C) -> Result<bool, RpaError>

fn update(
    entity_id: &String,
    entity: &T,
    connection: &C
) -> Result<usize, RpaError>

fn update_self(self, connection: &C) -> Result<usize, RpaError>

fn delete(entity_id: &String, connection: &C) -> Result<usize, RpaError>

fn delete_self(self, connection: &C) -> Result<usize, RpaError>

Loading content...


Loading content...