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
impl FormationMember
Sourcepub fn from_bundle(bundle: FormationBundle) -> Self
pub fn from_bundle(bundle: FormationBundle) -> Self
A member holding bundle, with no address yet.
Sourcepub fn address_wait(&self) -> Duration
pub fn address_wait(&self) -> Duration
How long a call to a callee waits for the callee’s address to arrive.
Sourcepub fn from_env(
formation_id: Option<&FormationId>,
) -> Result<Option<Arc<Self>>, RuntimeError>
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.
Sourcepub fn from_channel<R: Read + Send + 'static>(
channel: R,
formation_id: &FormationId,
deadline: Duration,
) -> Result<Arc<Self>, RuntimeError>
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.
pub fn formation_id(&self) -> &FormationId
Sourcepub fn launcher(&self) -> Option<&ProcessIdentity>
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.
Sourcepub fn is_entry(&self) -> bool
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.
Sourcepub fn verifier(&self) -> &FormationVerifier
pub fn verifier(&self) -> &FormationVerifier
What this member’s door checks a formation token with.
Sourcepub fn callees(&self) -> impl Iterator<Item = &str>
pub fn callees(&self) -> impl Iterator<Item = &str>
The members this one may call, in roster order.
Sourcepub fn guest_peers(&self) -> Option<FormationPeers>
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.
Sourcepub fn resolve(
&self,
name: &str,
wait: Duration,
) -> Option<(String, FormationToken)>
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.
Sourcepub fn install_addresses(&self, addresses: Vec<FormationPeer>)
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§
Auto Trait Implementations§
impl !Freeze for FormationMember
impl Forget for FormationMember
impl RefUnwindSafe for FormationMember
impl Send for FormationMember
impl Sync for FormationMember
impl Unpin for FormationMember
impl UnsafeUnpin for FormationMember
impl UnwindSafe for FormationMember
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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