[−][src]Enum mongodb_h2co3::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
header: Header | The message header. |
namespace: String | The full qualified name of the collection, beginning with the database name and a dot separator. |
number_to_return: i32 | The total number of documents that should be returned by the query. |
cursor_id: i64 | Uniquely identifies the cursor being returned. |
Methods
impl Message
[src]
impl Message
pub fn new_update(
request_id: i32,
namespace: String,
flags: OpUpdateFlags,
selector: Document,
update: Document
) -> Result<Message>
[src]
pub fn new_update(
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]
pub fn new_insert(
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]
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>
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]
pub fn new_get_more(
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]
pub fn write_update<W: Write>(
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]
pub fn write_get_more<W: Write>(
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]
pub fn write<W: Write>(&self, buffer: &mut W) -> Result<()>
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]
pub fn read<T>(buffer: &mut T) -> Result<Message> where
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
impl PartialEq<Message> for Message
[src]
impl PartialEq<Message> for Message
fn eq(&self, other: &Message) -> bool
[src]
fn eq(&self, other: &Message) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Message) -> bool
[src]
fn ne(&self, other: &Message) -> bool
This method tests for !=
.
impl Clone for Message
[src]
impl Clone for Message
fn clone(&self) -> Message
[src]
fn clone(&self) -> Message
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Message
[src]
impl Debug for Message
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 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]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 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, U> TryInto for T where
U: TryFrom<T>,
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self