Struct mongodb::options::WriteConcern[][src]

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

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)

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

impl WriteConcern[src]

pub fn builder() -> WriteConcernBuilder<((), (), ())>[src]

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

impl WriteConcern[src]

pub fn validate(&self) -> Result<()>[src]

Validates that the write concern. A write concern is invalid if the w field is 0 and the j field is true.

Trait Implementations

impl Clone for WriteConcern[src]

impl Debug for WriteConcern[src]

impl Default for WriteConcern[src]

impl<'de> Deserialize<'de> for WriteConcern[src]

impl PartialEq<WriteConcern> for WriteConcern[src]

impl Serialize for WriteConcern[src]

impl StructuralPartialEq for WriteConcern[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,