pub enum DeRecFlow {
Pairing {
kind: SenderKind,
contact: ContactMessage,
peer_communication_info: HashMap<String, String>,
},
Discovery {
target: Target,
},
ProtectSecret {
secrets: Vec<UserSecret>,
description: Option<String>,
},
VerifyShares {
secret_id: u64,
version: u32,
target: Target,
},
RecoverSecret {
secret_id: u64,
version: u32,
},
Unpair {
channel_id: ChannelId,
memo: Option<String>,
},
UpdateChannelInfo {
target: Target,
communication_info: Option<HashMap<String, String>>,
transport_protocol: Option<TransportProtocol>,
},
}Expand description
Describes an outbound protocol flow to initiate via super::DeRecProtocol::start.
§Role gating
The orchestrator enforces flow directionality against
crate::protocol::types::Channel::role (set at pairing time):
Self::Discovery,Self::ProtectSecret,Self::VerifyShares,Self::RecoverSecret, andSelf::Unpairrequire this node to be theSenderKind::Owneron every targeted channel; otherwisecrate::Error::RoleMismatchis returned.Self::Pairingcreates the channel, so no role exists yet.Self::UpdateChannelInfois symmetric — either party may initiate.
Variants§
Pairing
Fields
kind: SenderKindcontact: ContactMessagepeer_communication_info: HashMap<String, String>App-level identity metadata for the peer being paired with.
Stored verbatim on the resulting crate::protocol::types::Channel
(channel.communication_info). The protocol does not inspect
it — pass an empty map to record nothing.
Discovery
ProtectSecret
Publish the current secret to the protocol’s paired peers.
The secret identifier comes from the
super::DeRecProtocol instance (set at construction via
crate::protocol::DeRecProtocolBuilder::new) — one protocol
instance manages exactly one secret.
The target set is derived from the channel store: every paired Owner→Helper channel receives a share if the configured threshold is met, and every paired Source→ReplicaDestination channel receives the full secret payload. Apps that need to drive a single peer should pair just that peer; the protocol no longer accepts a per-call subset.
When the count of paired Helpers is below
crate::protocol::DeRecProtocolBuilder::with_threshold, no VSS
split runs and Helpers receive nothing — the secret still lands on
any paired Replica destinations in “secret-only” form.
RecoverSecret
Unpair
Initiate an unpair flow against a paired channel.
Owner-initiated only. This node must hold
derec_proto::SenderKind::Owner on channel_id; otherwise
crate::Error::RoleMismatch is returned. Helpers cannot tear
down the relationship from the protocol layer — they may only
refuse an incoming unpair request via
super::DeRecProtocol::reject.
Whether the local state for channel_id is dropped immediately on
start(Unpair) or only after the peer acknowledges is governed by
crate::protocol::DeRecProtocolBuilder::with_unpair_ack.
Fields
UpdateChannelInfo
Broadcast updated communication info and/or transport endpoint to one or more paired channels.
Either party may initiate. Either field may be None to leave it
unchanged; presence of communication_info (even with an empty map)
instructs the peer to replace its stored map for this channel with
the supplied one. Presence of transport_protocol instructs the peer
to use the new endpoint for the response and all subsequent messages.
The application is responsible for calling
crate::protocol::DeRecProtocol::set_communication_info and/or
crate::protocol::DeRecProtocol::set_own_transport before
initiating this flow so the local state matches what is announced.
See the setter docs for the endpoint-changeover discipline.
Auto Trait Implementations§
impl Freeze for DeRecFlow
impl RefUnwindSafe for DeRecFlow
impl Send for DeRecFlow
impl Sync for DeRecFlow
impl Unpin for DeRecFlow
impl UnsafeUnpin for DeRecFlow
impl UnwindSafe for DeRecFlow
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> 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