Skip to main content

Members

Struct Members 

Source
pub struct Members { /* private fields */ }
Expand description

The sorted, de-duplicated set of a run’s workers, plus this process’s own index. Sorting makes the assignment independent of the order workers happened to join in — the invariant owner_of relies on.

Implementations§

Source§

impl Members

Source

pub fn solo() -> Self

A single-worker run — the default when there is no --join. Byte-for-byte the pre-Phase-4 behaviour: one worker owns every task, and the fingerprint clause is empty.

Source

pub fn new(workers: Vec<String>, my_addr: &str) -> Result<Self, String>

From a membership list (in any order) and this process’s own address. The list is sorted and de-duplicated; me is this address’s index in the sorted set. Errors if my_addr is not in the set (a worker must be a member of the run it joins).

Source

pub fn len(&self) -> usize

The number of workers in the run.

Source

pub fn is_empty(&self) -> bool

Source

pub fn me(&self) -> WorkerId

This process’s worker id.

Source

pub fn is_solo(&self) -> bool

A run with exactly one worker: every edge is local and there is nothing to coordinate across processes.

Source

pub fn addr(&self, w: WorkerId) -> Option<&str>

The address of worker w (for opening exchange links to peers).

Source

pub fn peers(&self) -> impl Iterator<Item = WorkerId> + '_

Every worker’s id except this one — the peers this worker opens links to.

Source

pub fn fingerprint_clause(&self) -> String

The fingerprint clause for this member set. Empty for a solo run, so a single-worker fingerprint — and every checkpoint written before Phase 4 — is unchanged. For a cluster, the worker count: placement (owner_of) depends only on the number of workers, so a change to it changes every task’s owner and must refuse to restore over the old checkpoint (the D8 fence), while a restart of the same-sized cluster — on whatever addresses/ports — restores cleanly.

Trait Implementations§

Source§

impl Clone for Members

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 Members

Source§

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

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

impl Eq for Members

Source§

impl PartialEq for Members

Source§

fn eq(&self, other: &Self) -> bool

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Members

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.