pub enum Durability {
Synced,
Memory,
NotDurable,
Unknown,
}Expand description
Whether an event this runtime wrote reached this machine’s disk: what an append acknowledges, and the only thing a caller may say about it.
use majordomus_cli::mesh::journal::Durability;
assert_eq!(serde_json::to_value(Durability::NotDurable).unwrap(), "not_durable");
assert_eq!(Durability::default(), Durability::Unknown, "an answer that did not say");
assert!(Durability::Synced.is_on_disk() && !Durability::NotDurable.is_on_disk());Variants§
Synced
Appended to the journal file and synced (fsync of its data) before the append
returned.
Memory
The journal has no file: it lives in memory and its peers, by configuration.
NotDurable
The write to the journal file failed. The event is held in memory and replicated to peers, and is lost to this machine when the runtime restarts unless a peer still holds it. It is not acknowledged as durable.
Unknown
Not reported: an answer from an executable that predates this field.
Implementations§
Source§impl Durability
impl Durability
Sourcepub fn is_on_disk(self) -> bool
pub fn is_on_disk(self) -> bool
Whether the event is on this machine’s disk: only an append that was synced is.
use majordomus_cli::mesh::journal::Durability;
assert!(Durability::Synced.is_on_disk());
for not in [Durability::Memory, Durability::NotDurable, Durability::Unknown] {
assert!(!not.is_on_disk(), "{not:?} is not on disk");
}Trait Implementations§
Source§impl Clone for Durability
impl Clone for Durability
Source§fn clone(&self) -> Durability
fn clone(&self) -> Durability
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Durability
Source§impl Debug for Durability
impl Debug for Durability
Source§impl Default for Durability
impl Default for Durability
Source§fn default() -> Durability
fn default() -> Durability
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Durability
impl<'de> Deserialize<'de> for Durability
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Durability
Source§impl JsonSchema for Durability
impl JsonSchema for Durability
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for Durability
impl PartialEq for Durability
Source§fn eq(&self, other: &Durability) -> bool
fn eq(&self, other: &Durability) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Durability
impl Serialize for Durability
impl StructuralPartialEq for Durability
Auto Trait Implementations§
impl Freeze for Durability
impl RefUnwindSafe for Durability
impl Send for Durability
impl Sync for Durability
impl Unpin for Durability
impl UnsafeUnpin for Durability
impl UnwindSafe for Durability
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.