[][src]Trait mongodb::db::ThreadedDatabase

pub trait ThreadedDatabase {
    fn open(
        client: Client,
        name: &str,
        read_preference: Option<ReadPreference>,
        write_concern: Option<WriteConcern>
    ) -> Database;
fn version(&self) -> Result<Version>;
fn auth(&self, user: &str, password: &str) -> Result<()>;
fn collection(&self, coll_name: &str) -> Collection;
fn collection_with_prefs(
        &self,
        coll_name: &str,
        create: bool,
        read_preference: Option<ReadPreference>,
        write_concern: Option<WriteConcern>
    ) -> Collection;
fn get_req_id(&self) -> i32;
fn command_cursor(
        &self,
        spec: Document,
        cmd_type: CommandType,
        read_pref: ReadPreference
    ) -> Result<Cursor>;
fn command(
        &self,
        spec: Document,
        cmd_type: CommandType,
        read_preference: Option<ReadPreference>
    ) -> Result<Document>;
fn list_collections(&self, filter: Option<Document>) -> Result<Cursor>;
fn list_collections_with_batch_size(
        &self,
        filter: Option<Document>,
        batch_size: i32
    ) -> Result<Cursor>;
fn collection_names(&self, filter: Option<Document>) -> Result<Vec<String>>;
fn create_collection(
        &self,
        name: &str,
        options: Option<CreateCollectionOptions>
    ) -> Result<()>;
fn create_user(
        &self,
        name: &str,
        password: &str,
        options: Option<CreateUserOptions>
    ) -> Result<()>;
fn drop_all_users(&self, write_concern: Option<WriteConcern>) -> Result<i32>;
fn drop_collection(&self, name: &str) -> Result<()>;
fn drop_database(&self) -> Result<()>;
fn drop_user(&self, name: &str, _: Option<WriteConcern>) -> Result<()>;
fn get_all_users(&self, show_credentials: bool) -> Result<Vec<Document>>;
fn get_user(
        &self,
        user: &str,
        options: Option<UserInfoOptions>
    ) -> Result<Document>;
fn get_users(
        &self,
        users: Vec<&str>,
        options: Option<UserInfoOptions>
    ) -> Result<Vec<Document>>; }

Required Methods

Creates a database representation with optional read and write controls.

Logs in a user using the SCRAM-SHA-1 mechanism.

Creates a collection representation with inherited read and write controls.

Creates a collection representation with custom read and write controls.

Return a unique operational request id.

Generates a cursor for a relevant operational command.

Sends an administrative command over find_one.

Returns a list of collections within the database.

Returns a list of collections within the database with a custom batch size.

Returns a list of collection names within the database.

Creates a new collection.

Note that due to the implicit creation of collections during insertion, this method should only be used to instantiate capped collections.

Creates a new user.

Permanently deletes all users from the database.

Permanently deletes the collection from the database.

Permanently deletes the database from the server.

Permanently deletes the user from the database.

Retrieves information about all users in the database.

Retrieves information about a given user from the database.

Retrieves information about a given set of users from the database.

Implementors

impl ThreadedDatabase for Database
[src]