Skip to main content

FormationMember

Struct FormationMember 

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

One member’s live formation state: who it is, what its door accepts, the tokens for the members it may call, and the door URLs of those members as the channel delivers them.

Implementations§

Source§

impl FormationMember

Source

pub fn from_bundle(bundle: FormationBundle) -> Self

A member holding bundle, with no address yet.

Source

pub fn address_wait(&self) -> Duration

How long a call to a callee waits for the callee’s address to arrive.

Source

pub fn from_env( formation_id: Option<&FormationId>, ) -> Result<Option<Arc<Self>>, RuntimeError>

This session’s formation membership, read from the channel FORMATION_CHANNEL_ENV names.

Ok(None) when the variable is absent, which is every session but a formation member’s. Present, it requires formation_id — the MURMUR_FORMATION_ID the caller already read — marks the descriptor close-on-exec before anything else can be started, and reads the first line within FORMATION_CHANNEL_FIRST_LINE_DEADLINE. A thread then applies address lines until the channel ends.

Source

pub fn from_channel<R: Read + Send + 'static>( channel: R, formation_id: &FormationId, deadline: Duration, ) -> Result<Arc<Self>, RuntimeError>

Read a member’s first line from channel within deadline, check that it belongs to formation_id, and leave a thread applying the address lines that follow.

Source

pub fn name(&self) -> &str

This member’s roster name.

Source

pub fn formation_id(&self) -> &FormationId

Source

pub fn launcher(&self) -> Option<&ProcessIdentity>

The formation launcher that started this member, as its first line named it. None for a line that named none.

Source

pub fn is_entry(&self) -> bool

Whether this member is its formation’s entry member, as its first line said. A child this member delegates to is not a formation member at all, so it is never the entry member.

Source

pub fn verifier(&self) -> &FormationVerifier

What this member’s door checks a formation token with.

Source

pub fn callees(&self) -> impl Iterator<Item = &str>

The members this one may call, in roster order.

Source

pub fn guest_peers(&self) -> Option<FormationPeers>

What every WASM guest of this member is handed as MURMUR_FORMATION_PEERS: each callee at its virtual address. None when it may call nobody.

Source

pub fn resolve( &self, name: &str, wait: Duration, ) -> Option<(String, FormationToken)>

name’s real door URL and the token for it, waiting up to wait for the address to arrive. None for a member this one may not call, and for an address that does not arrive in time or will not arrive at all.

Source

pub fn install_addresses(&self, addresses: Vec<FormationPeer>)

Install each address in addresses whose name is a callee; every other name is ignored, so no route exists without a token.

Trait Implementations§

Source§

impl Debug for FormationMember

Source§

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

Formats the value using the given formatter. 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = !

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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more