Skip to main content

HelperChannel

Struct HelperChannel 

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

The peer’s role: Owner when this node is the helper, Helper when this node is the owner.

§status: ChannelStatus§created_at: u64§weight: u32

The 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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HelperChannel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for HelperChannel

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for HelperChannel

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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