Skip to main content

DeRecFlow

Enum DeRecFlow 

Source
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):

Variants§

§

Pairing

Fields

§peer_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

Fields

§target: Target
§

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.

Fields

§secrets: Vec<UserSecret>
§description: Option<String>
§

VerifyShares

Fields

§secret_id: u64
§version: u32
§target: Target
§

RecoverSecret

Fields

§secret_id: u64
§version: u32
§

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

§channel_id: ChannelId
§memo: Option<String>

Optional human-readable reason embedded into the wire request. Pass None (or an empty string) to omit.

§

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.

Fields

§target: Target
§communication_info: Option<HashMap<String, String>>

Updated communication info. None leaves the peer’s stored map untouched; Some(_) replaces it (an empty HashMap clears it).

§transport_protocol: Option<TransportProtocol>

Updated transport endpoint. None leaves it untouched.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V