[][src]Trait mongodb_cwal::gridfs::ThreadedStore

pub trait ThreadedStore {
    fn with_db(db: Database) -> Store;
fn with_prefix(db: Database, prefix: String) -> Store;
fn create(&self, name: String) -> Result<File>;
fn open(&self, name: String) -> Result<File>;
fn open_id(&self, id: ObjectId) -> Result<File>;
fn find(
        &self,
        filter: Option<Document>,
        options: Option<FindOptions>
    ) -> Result<FileCursor>;
fn remove(&self, name: String) -> Result<()>;
fn remove_id(&self, id: ObjectId) -> Result<()>;
fn put(&self, name: String) -> Result<()>;
fn get(&self, name: String) -> Result<()>; }

Required methods

fn with_db(db: Database) -> Store

A new GridFS store within the database with prefix 'fs'.

fn with_prefix(db: Database, prefix: String) -> Store

A new GridFS store within the database with a specified prefix.

fn create(&self, name: String) -> Result<File>

Creates a new file.

fn open(&self, name: String) -> Result<File>

Opens a file by filename.

fn open_id(&self, id: ObjectId) -> Result<File>

Opens a file by object ID.

fn find(
    &self,
    filter: Option<Document>,
    options: Option<FindOptions>
) -> Result<FileCursor>

Returns a cursor to all file documents matching the provided filter.

fn remove(&self, name: String) -> Result<()>

Removes a file from GridFS by filename.

fn remove_id(&self, id: ObjectId) -> Result<()>

Removes a file from GridFS by object ID.

fn put(&self, name: String) -> Result<()>

Inserts a new file from local into GridFS.

fn get(&self, name: String) -> Result<()>

Retrieves a file from GridFS into local storage.

Loading content...

Implementors

impl ThreadedStore for Store[src]

Loading content...