pub struct Successor { /* private fields */ }Expand description
Successor-side state machine, encoded as three concrete types so the compiler enforces protocol ordering. Lifecycle:
detect_rolereturns [Role::Successor(Successor)] — initial state.Successor::handshakeconsumes self and returnsHandshookSuccessor.HandshookSuccessor::wait_for_beginconsumes self and returnsBegunSuccessor.- From
BegunSuccessorthe consumer takes inherited listeners, opens its state, then callsBegunSuccessor::announce_and_bind(preferred) orBegunSuccessor::announce_ready.
Out-of-order calls don’t compile: there is no path from Successor to
take_listener or announce_ready that doesn’t pass through every
preceding state.
Implementations§
Source§impl Successor
impl Successor
Sourcepub fn handshake(self, build_id: Vec<u8>) -> Result<HandshookSuccessor>
pub fn handshake(self, build_id: Vec<u8>) -> Result<HandshookSuccessor>
Send Hello, receive HelloAck. Consumes self and returns a
HandshookSuccessor from which the next phase can proceed. On
protocol error the underlying UnixStream and inherited listeners
are dropped — the caller has no usable post-error state.
Sourcepub fn listener_names(&self) -> Vec<String>
pub fn listener_names(&self) -> Vec<String>
Names of all inherited listeners. Safe to call before handshake for
diagnostic / sanity checks (e.g. asserting the supervisor passed the
expected listeners). Listener consumption only happens post-Begin
via BegunSuccessor::take_listener.
Auto Trait Implementations§
impl Freeze for Successor
impl RefUnwindSafe for Successor
impl Send for Successor
impl Sync for Successor
impl Unpin for Successor
impl UnsafeUnpin for Successor
impl UnwindSafe for Successor
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
Mutably borrows from an owned value. Read more