Trait rpa::Rpa[][src]

pub trait Rpa<T, C> where
    C: Connection, 
{
Show 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 save_batch(
        entities: Vec<T, Global>,
        connection: &C
    ) -> Result<usize, RpaError>;
fn find(entity_id: &String, connection: &C) -> Result<T, RpaError>;
fn find_all(connection: &C) -> Result<Vec<T, Global>, 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>;
fn search(
        search_request: SearchRequest,
        connection: &C
    ) -> Result<SearchResponse<T>, RpaError>;
}
Expand description

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

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

Implementors