pub struct DisklessWalCapture {
pub format_version: u16,
pub captured_at_ms: u64,
pub source_cutoffs: Vec<i64>,
pub partitions: Vec<DisklessPartitionCapture>,
pub metadata_snapshot_sha256: Option<Sha256Digest>,
pub rlmm_snapshot_sha256: Option<Sha256Digest>,
pub group_offsets_sha256: Option<Sha256Digest>,
pub authentication: Option<SegmentManifest>,
}Expand description
Portable committed diskless-WAL capture.
Fields§
§format_version: u16§captured_at_ms: u64§source_cutoffs: Vec<i64>§partitions: Vec<DisklessPartitionCapture>§metadata_snapshot_sha256: Option<Sha256Digest>Digest of the controller checkpoint captured beside this boundary.
rlmm_snapshot_sha256: Option<Sha256Digest>Digest of the RLMM cache snapshot captured beside this boundary.
group_offsets_sha256: Option<Sha256Digest>Digest of the consumer-group offsets captured beside this boundary.
authentication: Option<SegmentManifest>Optional signed WORM boundary covering this capture and its WAL objects.
Implementations§
Source§impl DisklessWalCapture
impl DisklessWalCapture
Sourcepub fn seal(
&mut self,
objects: Vec<ObjectEntry>,
signer: &FileEd25519Signer,
) -> Result<ChainHead, String>
pub fn seal( &mut self, objects: Vec<ObjectEntry>, signer: &FileEd25519Signer, ) -> Result<ChainHead, String>
Sign the exact capture state and referenced WAL object claims.
§Errors
Returns an error when capture state is invalid, object claims do not exactly cover it, or its deterministic encoding fails.
Sourcepub fn authenticate(
&self,
trusted: &TrustedManifestKeys,
expected_head: Option<&str>,
) -> Result<BTreeMap<String, ObjectEntry>, String>
pub fn authenticate( &self, trusted: &TrustedManifestKeys, expected_head: Option<&str>, ) -> Result<BTreeMap<String, ObjectEntry>, String>
Verify the embedded signed boundary and return trusted WAL claims.
§Errors
Returns an error for invalid capture state, missing or untrusted evidence, a bad signature, a head mismatch, or incomplete object claims.
Source§impl DisklessWalCapture
impl DisklessWalCapture
Sourcepub const FORMAT_VERSION: u16 = 1
pub const FORMAT_VERSION: u16 = 1
Version of diskless-wal-index.json, its required top-level
"format_version" field.
Part of the 1.x on-disk contract: a 1.x restore reads every capture that any earlier 1.x build wrote.
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self, String>
pub fn from_slice(bytes: &[u8]) -> Result<Self, String>
Decode JSON and reject a missing or unknown capture version.
The version is read on its own first, so a capture of another version is reported as that, and not as whatever field its shape lacks.
§Errors
Returns an error for malformed JSON, a missing or unsupported version, or invalid state.
Trait Implementations§
Source§impl Clone for DisklessWalCapture
impl Clone for DisklessWalCapture
Source§fn clone(&self) -> DisklessWalCapture
fn clone(&self) -> DisklessWalCapture
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DisklessWalCapture
impl Debug for DisklessWalCapture
Source§impl<'de> Deserialize<'de> for DisklessWalCapture
impl<'de> Deserialize<'de> for DisklessWalCapture
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>,
impl Eq for DisklessWalCapture
Source§impl PartialEq for DisklessWalCapture
impl PartialEq for DisklessWalCapture
Source§impl Serialize for DisklessWalCapture
impl Serialize for DisklessWalCapture
impl StructuralPartialEq for DisklessWalCapture
Auto Trait Implementations§
impl Freeze for DisklessWalCapture
impl RefUnwindSafe for DisklessWalCapture
impl Send for DisklessWalCapture
impl Sync for DisklessWalCapture
impl Unpin for DisklessWalCapture
impl UnsafeUnpin for DisklessWalCapture
impl UnwindSafe for DisklessWalCapture
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<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
key and return true if they are equal.impl<F> FnGhost for F
§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§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);