#[non_exhaustive]
pub struct ChangeStreamEvent<T> { pub id: ResumeToken, pub operation_type: OperationType, pub ns: Option<ChangeNamespace>, pub to: Option<ChangeNamespace>, pub document_key: Option<Document>, pub update_description: Option<UpdateDescription>, pub cluster_time: Option<Timestamp>, pub full_document: Option<T>, }
Expand description

A ChangeStreamEvent represents a change event in the associated change stream.

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
id: ResumeToken

An opaque token for use when resuming an interrupted ChangeStream.

See the documentation here for more information on resume tokens.

Also see the documentation on resuming a change stream.

operation_type: OperationType

Describes the type of operation represented in this change notification.

ns: Option<ChangeNamespace>

Identifies the collection or database on which the event occurred.

to: Option<ChangeNamespace>

The new name for the ns collection. Only included for OperationType::Rename.

document_key: Option<Document>

A Document that contains the _id of the document created or modified by the insert, replace, delete, update operations (i.e. CRUD operations). For sharded collections, also displays the full shard key for the document. The _id field is not repeated if it is already a part of the shard key.

update_description: Option<UpdateDescription>

A description of the fields that were updated or removed by the update operation. Only specified if operation_type is OperationType::Update.

cluster_time: Option<Timestamp>

The cluster time at which the change occurred.

full_document: Option<T>

The Document created or modified by the insert, replace, delete, update operations (i.e. CRUD operations).

For insert and replace operations, this represents the new document created by the operation. For delete operations, this field is None.

For update operations, this field only appears if you configured the change stream with full_document set to UpdateLookup. This field then represents the most current majority-committed version of the document modified by the update operation.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.