[][src]Struct ipjdb::Collection

pub struct Collection { /* fields omitted */ }

Methods

impl Collection[src]

pub fn get_all<T>(&self) -> Result<Vec<Item<T>>, DbError> where
    T: Deserialize<'de>, 
[src]

pub fn find_many<T, F>(&self, f: F) -> Result<Vec<Item<T>>, DbError> where
    T: Deserialize<'de>,
    F: Fn(&Item<T>) -> bool
[src]

pub fn get_one<T>(&self, id: &Id) -> Result<Item<T>, DbError> where
    T: Deserialize<'de>, 
[src]

pub fn add_one<T>(&self, data: &T) -> Result<Id, DbError> where
    T: Serialize
[src]

pub fn delete_one(&self, id: &Id) -> Result<(), DbError>[src]

pub fn replace_one<T>(&self, item: &Item<T>) -> Result<(), DbError> where
    T: Serialize
[src]

pub fn update_by_id<T, U>(&self, id: &Id, u: U) -> Result<(), DbError> where
    T: Deserialize<'de> + Serialize,
    U: Fn(&Id, &T) -> T, 
[src]

pub fn update_many<T, F, U>(&self, f: F, u: U) -> Result<(), DbError> where
    T: Deserialize<'de> + Serialize,
    F: Fn(&Id, &T) -> bool,
    U: Fn(&Id, &T) -> T, 
[src]

Trait Implementations

impl Debug for Collection[src]

Auto Trait Implementations

impl Send for Collection

impl Sync for Collection

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]