struct MuxBusBlob {
tokens: MuxBusTokens,
generation: String,
}Expand description
On-disk JSON shape for the single-blob format (macOS/Linux’s preferred
layout, write_single_blob/blob_key). Wraps
MuxBusTokens with a generation stamp — the SAME new_generation()
nanosecond-timestamp scheme the chunked layout already uses for its own
cross-field torn-write check — so a blob and split entries found
coexisting (muxbus_load_tokens’s reconciliation) can be compared for
actual freshness instead of assuming a fixed direction is always right.
reagent P1 on PR #2665: an earlier version of the reconciliation logic
hardcoded “split is always fresher,” which was true for the ONE
historical case that motivated it (an old pre-fix blob→split migration
whose blob delete failed) but breaks once THIS fix’s own self-heal can
also leave stale split leftovers behind a newer blob (if
delete_split_tokens partially fails, then a later muxbus_save — which
on macOS/Linux only ever writes the blob — updates the blob but not the
stale split entries). An actual freshness comparison handles both
directions correctly instead of guessing.
#[serde(default)] on generation means a genuinely old, pre-fix
legacy blob (written before this stamp existed) deserializes with an
empty generation, which reads as timestamp 0 — always losing a
freshness comparison against any split entry’s real generation stamp,
which is exactly the right outcome for that original historical case.
Fields§
§tokens: MuxBusTokens§generation: StringTrait Implementations§
Source§impl Default for MuxBusBlob
impl Default for MuxBusBlob
Source§fn default() -> MuxBusBlob
fn default() -> MuxBusBlob
Source§impl<'de> Deserialize<'de> for MuxBusBlob
impl<'de> Deserialize<'de> for MuxBusBlob
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>,
Auto Trait Implementations§
impl Freeze for MuxBusBlob
impl RefUnwindSafe for MuxBusBlob
impl Send for MuxBusBlob
impl Sync for MuxBusBlob
impl Unpin for MuxBusBlob
impl UnsafeUnpin for MuxBusBlob
impl UnwindSafe for MuxBusBlob
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more