Skip to main content

Membership

Struct Membership 

Source
pub struct Membership<R: Role> { /* private fields */ }
Expand description

The complete declared output set of one plan — the output firewall.

The declared set is the whole set: a sibling that is not in it was not planned, and nothing downstream may materialize one. Structurally non-empty, because a plan that would generate nothing is a disposition rather than a plan.

Every member’s seat is in the kind’s declared roster, because admission refuses one that is not: every walk downstream — encoding, proof, reconstruction, delivery — quantifies over that roster, and a member outside it would be a unit those walks never look at, held by a proof that claims the whole set.

Implementations§

Source§

impl<R: Role> Membership<R>

Source

pub fn encode_into(&self, into: &mut Vec<u8>)

Appends this membership’s canonical bytes, in the kind’s declared ROSTER order.

Roster order and never declaration order: a declared output set is order-insensitive, so the same members declared in another order must encode identically. Every member standing under a seat is written rather than only the first, so a membership that doubled a seat encodes differently from one that did not — that is a defect closure reports, and the encoding must not hide it before the check runs.

Source§

impl<R: Role> Membership<R>

Source

pub fn from_member(member: PlannedMember<R>) -> Result<Self, PlanError>

The one-member output set.

§Errors

Returns one PlanIssue::MembershipForeign where the member’s seat is absent from the kind’s declared roster. The roster is every downstream walk’s denominator, so a member outside it is refused here rather than admitted, rendered, and dropped from a proof that claims the whole set.

Source

pub fn declared( first: PlannedMember<R>, rest: Vec<PlannedMember<R>>, ) -> Result<Self, PlanError>

Declares the complete output set, the first member and the rest.

§Errors

Returns the planning refusal naming BoundAxis::Outputs where the set outgrows MEMBERSHIP_LIMIT, one PlanIssue::MembershipForeign per member whose seat the kind’s roster does not declare, and one PlanIssue::MembershipDoubled per seat two members stand under. Both checks are here rather than downstream because each is a defect in the DECLARATION of the set: closure matches by seat over the roster, so a membership that reaches it doubled has already made that match elect one member and ignore the other, and one that reaches it with a foreign seat holds a member no walk will ever look at.

Source

pub fn first(&self) -> &PlannedMember<R>

The guaranteed first member.

Source

pub fn members(&self) -> &NonEmpty<PlannedMember<R>, MEMBERSHIP_LIMIT>

The declared members, the guaranteed first one ahead of the rest.

§Ordering

A declared output set is order-insensitive, and nothing identity-bearing is derived from this order: the canonical encoding walks the kind’s roster instead, so the same members declared in another order reach one plan.

Source

pub fn under(&self, role: R) -> Option<&PlannedMember<R>>

The member planned under one seat, where one is.

Source

pub fn members_under(&self, role: R) -> impl Iterator<Item = &PlannedMember<R>>

Every member planned under one seat, in declaration order.

The road a complete-set comparison walks: comparing two memberships by their first member per seat would agree about two sets that differ in their second, which is exactly what a doubled seat produces.

Source

pub fn count_under(&self, role: R) -> usize

How many members are planned under one seat.

Source

pub fn members_to( &self, destination: Destination, ) -> impl Iterator<Item = &PlannedMember<R>>

Every member this plan declared into one delivery, in declaration order.

The reading that routes, and it elects nothing: a member’s delivery is its seat’s own constant answer (Role::destination), so a join asking which members it emits and a consumption target asking which cargo it receives take one answer rather than two that agree until one is edited.

Source

pub fn count_to(&self, destination: Destination) -> usize

How many members this plan declared into one delivery.

Zero is a stated answer rather than an absence: a plan that declared nothing into a delivery has an unoccupied one there, which is a different fact from a delivery that carries no bytes.

Source

pub fn agrees_under(&self, other: &Self, role: R) -> bool

Whether two memberships name the same members under one seat, as sets.

Source

pub fn count(&self) -> usize

The number of members declared; structurally at least one.

Trait Implementations§

Source§

impl<R: Clone + Role> Clone for Membership<R>

Source§

fn clone(&self) -> Membership<R>

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<R: Debug + Role> Debug for Membership<R>

Source§

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

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

impl<R: Eq + Role> Eq for Membership<R>

Source§

impl<R: PartialEq + Role> PartialEq for Membership<R>

Source§

fn eq(&self, other: &Membership<R>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<R: PartialEq + Role> StructuralPartialEq for Membership<R>

Auto Trait Implementations§

§

impl<R> Freeze for Membership<R>
where NonEmpty<PlannedMember<R>, MEMBERSHIP_LIMIT>: Freeze,

§

impl<R> RefUnwindSafe for Membership<R>
where NonEmpty<PlannedMember<R>, MEMBERSHIP_LIMIT>: RefUnwindSafe,

§

impl<R> Send for Membership<R>
where NonEmpty<PlannedMember<R>, MEMBERSHIP_LIMIT>: Send,

§

impl<R> Sync for Membership<R>
where NonEmpty<PlannedMember<R>, MEMBERSHIP_LIMIT>: Sync,

§

impl<R> Unpin for Membership<R>
where NonEmpty<PlannedMember<R>, MEMBERSHIP_LIMIT>: Unpin,

§

impl<R> UnsafeUnpin for Membership<R>
where NonEmpty<PlannedMember<R>, MEMBERSHIP_LIMIT>: UnsafeUnpin,

§

impl<R> UnwindSafe for Membership<R>
where NonEmpty<PlannedMember<R>, MEMBERSHIP_LIMIT>: UnwindSafe,

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<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> 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> 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, <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.