pub enum OnboardMessage {
CreateSession {
requester: InstanceId,
session_id: SessionId,
sequence_hashes: Vec<SequenceHash>,
},
SearchComplete {
responder: InstanceId,
session_id: SessionId,
},
G2Results {
responder: InstanceId,
session_id: SessionId,
sequence_hashes: Vec<SequenceHash>,
block_ids: Vec<BlockId>,
},
G3Results {
responder: InstanceId,
session_id: SessionId,
sequence_hashes: Vec<SequenceHash>,
},
HoldBlocks {
requester: InstanceId,
session_id: SessionId,
hold_hashes: Vec<SequenceHash>,
drop_hashes: Vec<SequenceHash>,
},
StageBlocks {
requester: InstanceId,
session_id: SessionId,
stage_hashes: Vec<SequenceHash>,
},
BlocksReady {
responder: InstanceId,
session_id: SessionId,
sequence_hashes: Vec<SequenceHash>,
block_ids: Vec<BlockId>,
},
Acknowledged {
responder: InstanceId,
session_id: SessionId,
},
ReleaseBlocks {
requester: InstanceId,
session_id: SessionId,
release_hashes: Vec<SequenceHash>,
},
CloseSession {
requester: InstanceId,
session_id: SessionId,
},
G4Results {
session_id: SessionId,
found_hashes: Vec<(SequenceHash, usize)>,
},
G4LoadComplete {
session_id: SessionId,
success: Vec<SequenceHash>,
failures: Vec<(SequenceHash, String)>,
blocks: Arc<Vec<ImmutableBlock<G2>>>,
},
}Expand description
Message types for session communication. Messages exchanged between leaders during onboarding sessions.
Phase 2 protocol (G2-only):
- Initiator sends CreateSession to multiple responders
- Each responder searches local G2 and sends G2Results back
- Initiator applies first-responder-wins and sends HoldBlocks to each
- Responders send Acknowledged after releasing unwanted blocks
Phase 3 protocol (G3 staging): 5. Responders search G3 and send G3Results 6. Initiator sends StageBlocks with blocks to stage G3->G2 7. Responders stage blocks and send BlocksReady when complete
Variants§
CreateSession
Initiator creates a new onboarding session.
SearchComplete
Responder signals local search (G2 and G3) is complete.
G2Results
Responder reports G2 search results.
- sequence_hashes: ordered list of matched sequence hashes
- block_ids: parallel list of block IDs (can be zipped with sequence_hashes)
G3Results
Responder reports G3 search results.
- sequence_hashes: ordered list of matched sequence hashes (no block IDs)
HoldBlocks
Initiator tells responder which sequence hashes to hold/drop. Works across G2 and G3 tiers.
StageBlocks
Initiator tells responder which G3 sequence hashes to stage to G2. Any G3 blocks with these hashes should be staged to G2.
BlocksReady
Responder reports newly staged blocks are ready in G2 (after G3->G2 staging). Only reports blocks that were just staged, not all G2 blocks.
- sequence_hashes: newly staged blocks
- block_ids: parallel to sequence_hashes
Acknowledged
Responder acknowledges hold/drop request.
ReleaseBlocks
Initiator tells responder to release specific sequence hashes that weren’t selected. Works across G2 and G3 tiers.
CloseSession
Initiator tells responder session is complete, responder can cleanup.
G4Results
G4 search results from object storage has_blocks.
Internal message sent via mpsc channel from the G4 search task to the initiator session. Contains hashes found in object storage with their sizes.
Fields
found_hashes: Vec<(SequenceHash, usize)>Hashes found in G4 with their sizes in bytes
G4LoadComplete
G4 load completion results from object storage get_blocks.
Internal message sent via mpsc channel from the G4 load task to the initiator session. Contains per-block success/failure.
Fields
success: Vec<SequenceHash>Successfully loaded hashes
failures: Vec<(SequenceHash, String)>Failed hashes with error messages
blocks: Arc<Vec<ImmutableBlock<G2>>>Successfully loaded and registered G2 blocks. These are ready to be added to local_g2_blocks. Wrapped in Arc for Clone derivation (internal message only).
Implementations§
Source§impl OnboardMessage
impl OnboardMessage
Sourcepub fn session_id(&self) -> SessionId
pub fn session_id(&self) -> SessionId
Extract the session ID from any message variant.
Sourcepub fn instance_id(&self) -> InstanceId
pub fn instance_id(&self) -> InstanceId
Extract the requester/responder instance ID from the message.
§Panics
Panics if called on G4 messages (internal only, no instance ID).
Sourcepub fn variant_name(&self) -> &'static str
pub fn variant_name(&self) -> &'static str
Get the variant name as a string for logging.
Trait Implementations§
Source§impl Clone for OnboardMessage
impl Clone for OnboardMessage
Source§fn clone(&self) -> OnboardMessage
fn clone(&self) -> OnboardMessage
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 OnboardMessage
impl Debug for OnboardMessage
Source§impl<'de> Deserialize<'de> for OnboardMessage
impl<'de> Deserialize<'de> for OnboardMessage
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 !RefUnwindSafe for OnboardMessage
impl !UnwindSafe for OnboardMessage
impl Freeze for OnboardMessage
impl Send for OnboardMessage
impl Sync for OnboardMessage
impl Unpin for OnboardMessage
impl UnsafeUnpin for OnboardMessage
Blanket Implementations§
impl<T> BlockMetadata for T
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>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§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();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§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();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§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();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§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();Source§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.
Source§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);