[−][src]Trait gosh_database::prelude::Collection
Required methods
fn collection_name() -> String
Return an unique name as the container for your data.
Provided methods
fn put_into_collection(&self, db: &DbConnection, new_key: &str) -> Result<()>
Put self into collection.
fn get_from_collection(db: &DbConnection, obj_key: &str) -> Result<Self>
Return the object in this collection by key.
fn del_from_collection(db: &DbConnection, obj_key: &str) -> Result<()>
Delete the object in this collection by key.
fn remove_collection(db: &DbConnection) -> Result<()>
Remove all objects in this collection.
fn list_collection(db: &DbConnection) -> Result<Vec<Self>>
List all items in the collection.
fn collection_size(db: &DbConnection) -> Result<i64>
Return the number of items in collection.