pub struct ResidentDoor { /* private fields */ }Expand description
The resident door’s server-side state: this boot’s token and the seat —
the attached resident’s pid, for liveness probing. Shared with the
supervisor ([crate::wave::supervisor]), which probes attached pids and
clears the seat when the resident dies.
The token is held as a SecretString and compared in constant time
(subtle::ConstantTimeEq) — never ==, never surfaced in Debug or a
log.
Implementations§
Source§impl ResidentDoor
impl ResidentDoor
pub fn new(token: impl Into<String>) -> Self
Sourcepub fn seat_pid(&self) -> Option<u32>
pub fn seat_pid(&self) -> Option<u32>
The attached resident’s pid, if one has attached and not been cleared.
Sourcepub fn record_pid(&self, pid: u32)
pub fn record_pid(&self, pid: u32)
Record the resident occupying the seat (attach, or spawn).
Sourcepub fn clear_seat(&self)
pub fn clear_seat(&self)
The resident died: free the seat.
Trait Implementations§
Source§impl Clone for ResidentDoor
impl Clone for ResidentDoor
Source§fn clone(&self) -> ResidentDoor
fn clone(&self) -> ResidentDoor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ResidentDoor
impl RefUnwindSafe for ResidentDoor
impl Send for ResidentDoor
impl Sync for ResidentDoor
impl Unpin for ResidentDoor
impl UnsafeUnpin for ResidentDoor
impl UnwindSafe for ResidentDoor
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