Enum mongodb::wire_protocol::operations::Message [] [src]

pub enum Message {
    OpReply {
        header: Header,
        flags: OpReplyFlags,
        cursor_id: i64,
        starting_from: i32,
        number_returned: i32,
        documents: Vec<Document>,
    },
    OpUpdate {
        header: Header,
        namespace: String,
        flags: OpUpdateFlags,
        selector: Document,
        update: Document,
    },
    OpInsert {
        header: Header,
        flags: OpInsertFlags,
        namespace: String,
        documents: Vec<Document>,
    },
    OpQuery {
        header: Header,
        flags: OpQueryFlags,
        namespace: String,
        number_to_skip: i32,
        number_to_return: i32,
        query: Document,
        return_field_selector: Option<Document>,
    },
    OpGetMore {
        header: Header,
        namespace: String,
        number_to_return: i32,
        cursor_id: i64,
    },
}

Represents a message in the MongoDB Wire Protocol.

Variants

Fields

The message header.

A Bit vector of reply options.

Uniquely identifies the cursor being returned.

The starting position for the cursor.

The total number of documents being returned.

The documents being returned.

Fields

The message header.

The full qualified name of the collection, beginning with the database name and a dot separator.

A bit vector of update options.

Identifies the document(s) to be updated.

Instruction document for how to update the document(s).

Fields

The message header.

A bit vector of insert options.

The full qualified name of the collection, beginning with the database name and a dot separator.

The documents to be inserted.

Fields

The message header.

A bit vector of query options.

The full qualified name of the collection, beginning with the database name and a dot separator.

The number of initial documents to skip over in the query results.

The total number of documents that should be returned by the query.

Specifies which documents to return.

An optional projection of which fields should be present in the documents to be returned by the query.

Fields

The message header.

The full qualified name of the collection, beginning with the database name and a dot separator.

The total number of documents that should be returned by the query.

Uniquely identifies the cursor being returned.

Methods

impl Message
[src]

Constructs a new message for an update.

Constructs a new message request for an insertion.

Constructs a new message request for a query.

Constructs a new "get more" request message.

Writes a serialized update message to a given buffer.

Arguments

buffer - The buffer to write to. header - The header for the given message. namespace - The full qualified name of the collection, beginning with the database name and a dot. flags - Bit vector of query option. selector - Identifies the document(s) to be updated. update - Instructs how to update the document(s).

Return value

Returns nothing on success, or an Error on failure.

Writes a serialized "get more" request to a given buffer.

Arguments

buffer - The buffer to write to. header - The header for the given message. namespace - The full qualified name of the collection, beginning with the database name and a dot. number_to_return - The total number of documents that should be returned by the query.cursor_id` - Specifies which cursor to get more documents from.

Return value

Returns nothing on success, or an Error on failure.

Attemps to write the serialized message to a buffer.

Arguments

buffer - The buffer to write to.

Return value

Returns nothing on success, or an error string on failure.

Attempts to read a serialized reply Message from a buffer.

Arguments

buffer - The buffer to read from.

Return value

Returns the reply message on success, or an Error on failure.