pub struct HelperChannel {
pub channel_id: ChannelId,
pub transports: Vec<TransportProtocol>,
pub communication_info: HashMap<String, String>,
pub peer_role: SenderKind,
pub status: ChannelStatus,
pub created_at: u64,
pub weight: u32,
}Expand description
A channel to a single helper, or to the owner from a helper’s side.
Keyed by (secret_id, channel_id). Also the record written while an
owner-helper pairing is still in flight — that flow is unchanged.
Fields§
§channel_id: ChannelId§transports: Vec<TransportProtocol>Every endpoint this peer advertised, in the order it offered them.
The library never ranks these — it filters them through
TransportPolicy and hands the
survivors to DeRecTransport::send,
which is the application’s to choose among and fail over between.
§Reading a pre-0.0.3 stored record
This replaced a single transport field. A record written by an older
build still loads: the deserializer accepts either spelling and lifts
a lone transport object into a one-element list, so no application
has to migrate a schema the library defines. See
CHANNEL_RECORD_SCHEMA_VERSION.
What is not accepted is a record naming no endpoint at all — absent under both spellings, or present and empty. Defaulting those to an empty list would yield a channel that looks paired and is unreachable, which is worse than one that refuses to load, so they stay a loud deserialization error.
communication_info: HashMap<String, String>§peer_role: SenderKindThe peer’s role: Owner when this node is the helper, Helper
when this node is the owner.
status: ChannelStatus§created_at: u64§weight: u32The number of Shamir subshares this Helper receives: the weight the
last DeRecFlow::ProtectSecret
resolved for it, reused by every publish the library starts on its own.
Each ProtectSecret round writes the weight it gave every paired
Helper, before anything is sent: its weights entry, or 1 when the
map does not name it. A new pairing starts at 1. The value travels in
the roster as HelperInfo::weight,
so restore and replica hydration write it back. A record stored before
this field existed reads as 1, and so does a stored 0: 0 is never
a valid weight, so it can only come from a writer that predates the
field. On the helper side of a channel
(peer_role == Owner) it is unused and stays 1.
Trait Implementations§
Source§impl Clone for HelperChannel
impl Clone for HelperChannel
Source§impl Debug for HelperChannel
impl Debug for HelperChannel
Source§impl<'de> Deserialize<'de> for HelperChannel
impl<'de> Deserialize<'de> for HelperChannel
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 Forget for HelperChannel
impl Freeze for HelperChannel
impl Move for HelperChannel
impl RefUnwindSafe for HelperChannel
impl Send for HelperChannel
impl Sync for HelperChannel
impl Unpin for HelperChannel
impl UnsafeUnpin for HelperChannel
impl UnwindSafe for HelperChannel
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>,
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