pub struct WriteOutcome { /* private fields */ }Expand description
Outcome returned when a writer is committed.
§Examples
use qubit_fs::metadata::{AchievedAtomicity, PublicationMethod, WriteOutcome};
let outcome = WriteOutcome::new(AchievedAtomicity::Atomic, PublicationMethod::Direct);
assert_eq!(AchievedAtomicity::Atomic, outcome.atomicity());Implementations§
Source§impl WriteOutcome
impl WriteOutcome
Sourcepub fn new(atomicity: AchievedAtomicity, method: PublicationMethod) -> Self
pub fn new(atomicity: AchievedAtomicity, method: PublicationMethod) -> Self
Sourcepub const fn bytes_written(&self) -> Option<u64>
pub const fn bytes_written(&self) -> Option<u64>
Returns the number of bytes accepted by the write session, when known.
Sourcepub const fn version(&self) -> Option<&ResourceVersion>
pub const fn version(&self) -> Option<&ResourceVersion>
Returns the provider version, generation, or ETag when known.
Sourcepub const fn atomicity(&self) -> AchievedAtomicity
pub const fn atomicity(&self) -> AchievedAtomicity
Returns the atomicity actually achieved by publication.
Sourcepub const fn method(&self) -> PublicationMethod
pub const fn method(&self) -> PublicationMethod
Returns the concrete method that published the resource.
Sourcepub const fn durable(&self) -> bool
pub const fn durable(&self) -> bool
Returns whether the provider confirmed durable publication.
Sourcepub const fn diagnostics(&self) -> &NonSensitiveMetadata
pub const fn diagnostics(&self) -> &NonSensitiveMetadata
Returns provider-native non-sensitive diagnostics.
Sourcepub const fn with_bytes_written(self, bytes_written: u64) -> Self
pub const fn with_bytes_written(self, bytes_written: u64) -> Self
Records the byte count confirmed by the provider.
Sourcepub fn with_version(self, version: ResourceVersion) -> Self
pub fn with_version(self, version: ResourceVersion) -> Self
Records the provider version, generation, or ETag.
Sourcepub const fn with_durable(self, durable: bool) -> Self
pub const fn with_durable(self, durable: bool) -> Self
Records whether data and namespace publication were durably synchronized.
Sourcepub fn with_diagnostics(self, diagnostics: UserMetadata) -> Self
pub fn with_diagnostics(self, diagnostics: UserMetadata) -> Self
Replaces provider-native diagnostics that have already passed key validation.
Trait Implementations§
Source§impl Clone for WriteOutcome
impl Clone for WriteOutcome
Source§impl Debug for WriteOutcome
impl Debug for WriteOutcome
Source§impl PartialEq for WriteOutcome
impl PartialEq for WriteOutcome
impl StructuralPartialEq for WriteOutcome
Auto Trait Implementations§
impl Freeze for WriteOutcome
impl RefUnwindSafe for WriteOutcome
impl Send for WriteOutcome
impl Sync for WriteOutcome
impl Unpin for WriteOutcome
impl UnsafeUnpin for WriteOutcome
impl UnwindSafe for WriteOutcome
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more