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

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 of OpReply

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 of OpUpdate

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 of OpInsert

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 of OpQuery

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 of OpGetMore

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.

Trait Implementations

impl PartialEq<Message> for Message
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for Message
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Message
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Message

impl Sync for Message

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

impl<T> Same for T

Should always be Self