[−][src]Enum mongodb::wire_protocol::operations::Message
Represents a message in the MongoDB Wire Protocol.
Variants
OpReply
Fields of OpReply
header: Header
The message header.
flags: OpReplyFlags
A Bit vector of reply options.
cursor_id: i64
Uniquely identifies the cursor being returned.
starting_from: i32
The starting position for the cursor.
number_returned: i32
The total number of documents being returned.
documents: Vec<Document>
The documents being returned.
OpUpdate
Fields of OpUpdate
header: Header
The message header.
namespace: String
The full qualified name of the collection, beginning with the database name and a dot separator.
flags: OpUpdateFlags
A bit vector of update options.
selector: Document
Identifies the document(s) to be updated.
update: Document
Instruction document for how to update the document(s).
OpInsert
Fields of OpInsert
header: Header
The message header.
flags: OpInsertFlags
A bit vector of insert options.
namespace: String
The full qualified name of the collection, beginning with the database name and a dot separator.
documents: Vec<Document>
The documents to be inserted.
OpQuery
Fields of OpQuery
header: Header
The message header.
flags: OpQueryFlags
A bit vector of query options.
namespace: String
The full qualified name of the collection, beginning with the database name and a dot separator.
number_to_skip: i32
The number of initial documents to skip over in the query results.
number_to_return: i32
The total number of documents that should be returned by the query.
query: Document
Specifies which documents to return.
return_field_selector: Option<Document>
An optional projection of which fields should be present in the documents to be returned by the query.
OpGetMore
Fields of OpGetMore
Methods
impl Message
[src]
pub fn new_update(
request_id: i32,
namespace: String,
flags: OpUpdateFlags,
selector: Document,
update: Document
) -> Result<Message>
[src]
request_id: i32,
namespace: String,
flags: OpUpdateFlags,
selector: Document,
update: Document
) -> Result<Message>
Constructs a new message for an update.
pub fn new_insert(
request_id: i32,
flags: OpInsertFlags,
namespace: String,
documents: Vec<Document>
) -> Result<Message>
[src]
request_id: i32,
flags: OpInsertFlags,
namespace: String,
documents: Vec<Document>
) -> Result<Message>
Constructs a new message request for an insertion.
pub fn new_query(
request_id: i32,
flags: OpQueryFlags,
namespace: String,
number_to_skip: i32,
number_to_return: i32,
query: Document,
return_field_selector: Option<Document>
) -> Result<Message>
[src]
request_id: i32,
flags: OpQueryFlags,
namespace: String,
number_to_skip: i32,
number_to_return: i32,
query: Document,
return_field_selector: Option<Document>
) -> Result<Message>
Constructs a new message request for a query.
pub fn new_get_more(
request_id: i32,
namespace: String,
number_to_return: i32,
cursor_id: i64
) -> Message
[src]
request_id: i32,
namespace: String,
number_to_return: i32,
cursor_id: i64
) -> Message
Constructs a new "get more" request message.
pub fn write_update<W: Write>(
buffer: &mut W,
header: &Header,
namespace: &str,
flags: &OpUpdateFlags,
selector: &Document,
update: &Document
) -> Result<()>
[src]
buffer: &mut W,
header: &Header,
namespace: &str,
flags: &OpUpdateFlags,
selector: &Document,
update: &Document
) -> Result<()>
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.
pub fn write_get_more<W: Write>(
buffer: &mut W,
header: &Header,
namespace: &str,
number_to_return: i32,
cursor_id: i64
) -> Result<()>
[src]
buffer: &mut W,
header: &Header,
namespace: &str,
number_to_return: i32,
cursor_id: i64
) -> Result<()>
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.
pub fn write<W: Write>(&self, buffer: &mut W) -> Result<()>
[src]
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.
pub fn read<T>(buffer: &mut T) -> Result<Message> where
T: Read + Write,
[src]
T: Read + Write,
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
Auto Trait Implementations
impl Unpin for Message
impl Sync for Message
impl Send for Message
impl UnwindSafe for Message
impl RefUnwindSafe for Message
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> Same<T> for T
type Output = T
Should always be Self