Rust

client

Module

[Client]: one MongoDB deployment, reached through the official driver.

Contents

1 submodule, and what the module defines itself.

use utopia_mongo::Client;
Rust
pub struct Client

A MongoDB client. See the crate docs.

Also implements Debug.
use utopia_mongo::Config;
Rust
pub struct Config

How to reach the server and authenticate.

use utopia_mongo::ConnectionInfo;
Rust
pub struct ConnectionInfo

Undocumented.

use utopia_mongo::Options;
Rust
pub struct Options

Undocumented.

use utopia_mongo::ReadConcern;
Rust
pub struct ReadConcern

A read concern a command carries (readConcern).

use utopia_mongo::Session;
Rust
pub struct Session

A logical session: transactions run on one. A cheap handle; the client keeps its state.

use utopia_mongo::SessionState;
Rust
pub struct SessionState

A session's bookkeeping.

use utopia_mongo::Upsert;
Rust
pub struct Upsert

One upsert of Client::upsert.

use utopia_mongo::WriteConcern;
Rust
pub struct WriteConcern

A write concern a command carries (writeConcern).

use utopia_mongo::Reply;
Rust
pub enum Reply

What a command returned: its n (documents counted, inserted, matched or deleted) when the reply has one, the whole reply otherwise.

use utopia_mongo::TransactionState;
Rust
pub enum TransactionState

Where a session's transaction is.

use utopia_mongo::client::int;
Rust
pub fn int(value: i64) -> Bson

Undocumented.

use utopia_mongo::client::string;
Rust
pub fn string(bytes: &[u8]) -> Bson

Undocumented.

use utopia_mongo::client::unencoded;
Rust
pub fn unencoded(binary: &Binary) -> Option<&[u8]>

Undocumented.

Rust
pub const READ_CONCERNS: [&str; 5] = ["local", "available", "majority", "linearizable", "snapshot"]

Read concern levels createReadConcern accepts.

Rust
pub const STRING: BinarySubtype = BinarySubtype::UserDefined(0xfe)

Undocumented.

Rust
pub const TRANSACTION_ABORTED_ERROR: i64 = 251

NoSuchTransaction.

Rust
pub const TRANSACTION_TIMEOUT_ERROR: i64 = 50

MaxTimeMSExpired.

Rust
pub const TRANSIENT_TRANSACTION_ERROR: &str = "TransientTransactionError"

TransientTransactionError: the label of a transaction that may be retried.

Rust
pub const UNKNOWN_TRANSACTION_COMMIT_RESULT: &str = "UnknownTransactionCommitResult"

UnknownTransactionCommitResult: the label of a commit that may have applied.

client::command

Own page

The command names of Client::COMMAND_*.

Rust
pub const ABORT_TRANSACTION: &str = "abortTransaction"

COMMAND_ABORT_TRANSACTION.

Rust
pub const AGGREGATE: &str = "aggregate"

COMMAND_AGGREGATE.

Rust
pub const COLLMOD: &str = "collMod"

COMMAND_COLLMOD.

Rust
pub const COMMIT_TRANSACTION: &str = "commitTransaction"

COMMAND_COMMIT_TRANSACTION.

Rust
pub const COUNT: &str = "count"

COMMAND_COUNT.

Rust
pub const CREATE: &str = "create"

COMMAND_CREATE.

Rust
pub const DELETE: &str = "delete"

COMMAND_DELETE.

Rust
pub const DISTINCT: &str = "distinct"

COMMAND_DISTINCT.

Rust
pub const END_SESSIONS: &str = "endSessions"

COMMAND_END_SESSIONS.

Rust
pub const FIND: &str = "find"

COMMAND_FIND.

Rust
pub const FIND_AND_MODIFY: &str = "findAndModify"

COMMAND_FIND_AND_MODIFY.

Rust
pub const GET_LAST_ERROR: &str = "getLastError"

COMMAND_GET_LAST_ERROR.

Rust
pub const GET_MORE: &str = "getMore"

COMMAND_GET_MORE.

Rust
pub const INSERT: &str = "insert"

COMMAND_INSERT.

Rust
pub const KILL_CURSORS: &str = "killCursors"

COMMAND_KILL_CURSORS.

Rust
pub const LIST_INDEXES: &str = "listIndexes"

COMMAND_LIST_INDEXES.

Rust
pub const MAP_REDUCE: &str = "mapReduce"

COMMAND_MAP_REDUCE.

Rust
pub const RESET_ERROR: &str = "resetError"

COMMAND_RESET_ERROR.

Rust
pub const START_SESSION: &str = "startSession"

COMMAND_START_SESSION.

Rust
pub const UPDATE: &str = "update"

COMMAND_UPDATE.