pub struct Supervisor { /* private fields */ }Expand description
One supervised primitive instance.
Implementations§
Source§impl Supervisor
impl Supervisor
pub fn new(socket_path: &Path) -> Result<Self>
Sourcepub fn with_listener(self, name: impl Into<String>, fd: RawFd) -> Self
pub fn with_listener(self, name: impl Into<String>, fd: RawFd) -> Self
Register an inherited listener. The supervisor must keep the underlying
TcpListener alive elsewhere; this just records the raw FD and the
name to advertise via LISTEN_FDNAMES. Consuming-builder shape so it
composes with with_journal / with_build_id:
ⓘ
let sup = Supervisor::new(path)?
.with_listener("http", fd)
.with_journal(journal_path);pub fn with_journal(self, path: PathBuf) -> Self
pub fn with_build_id(self, build_id: Vec<u8>) -> Self
pub fn perform_handoff(&self, spec: SpawnSpec) -> Result<HandoffOutcome>
Sourcepub fn resume_from_journal(&self) -> Result<Option<StateJournal>>
pub fn resume_from_journal(&self) -> Result<Option<StateJournal>>
Read any persisted in-flight handoff state and clear it. Call once
before the first perform_handoff after a supervisor restart.
The current incumbent auto-recovers from disconnect (sealed → re-acquire
flock + resume; drained → resume), so the supervisor’s restart-time
responsibility is bounded: confirm the incumbent is reachable and
clear the journal. Returns the persisted state (for logging) or None
if no journal exists.
Auto Trait Implementations§
impl !Freeze for Supervisor
impl RefUnwindSafe for Supervisor
impl Send for Supervisor
impl Sync for Supervisor
impl Unpin for Supervisor
impl UnsafeUnpin for Supervisor
impl UnwindSafe for Supervisor
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