#[non_exhaustive]
pub struct WriteConcern { pub w: Option<Acknowledgment>, pub w_timeout: Option<Duration>, pub journal: Option<bool>, }
Expand description

Specifies the level of acknowledgement requested from the server for write operations.

See the documentation here for more information about write concerns.

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.
w: Option<Acknowledgment>

Requests acknowledgement that the operation has propagated to a specific number or variety of servers.

w_timeout: Option<Duration>

Specifies a time limit for the write concern. If an operation has not propagated to the requested level within the time limit, an error will return.

Note that an error being returned due to a write concern error does not imply that the write would not have finished propagating if allowed more time to finish, and the server will not roll back the writes that occurred before the timeout was reached.

journal: Option<bool>

Requests acknowledgement that the operation has propagated to the on-disk journal.

Implementations

Create a builder for building WriteConcern. On the builder, call .w(...)(optional), .w_timeout(...)(optional), .journal(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of WriteConcern.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. 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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.