pub struct DaemonControl {
pub cfg: SharedConfig,
pub config_path: PathBuf,
pub paused: Arc<AtomicBool>,
pub stop: Arc<AtomicBool>,
pub registration: SharedRegistration,
pub reset_requested: Arc<AtomicBool>,
pub vram_total_gb: f32,
}Expand description
The daemon’s shared runtime handles. Cheap to clone.
Fields§
§cfg: SharedConfig§config_path: PathBuf§paused: Arc<AtomicBool>Runtime pause toggle (never persisted).
stop: Arc<AtomicBool>Set to stop the daemon gracefully.
registration: SharedRegistration§reset_requested: Arc<AtomicBool>Raised by DaemonControl::request_registration_reset; consumed by
the rejection wait in runtime::serve_studio.
vram_total_gb: f32Total device memory, probed once at start.
Implementations§
Source§impl DaemonControl
impl DaemonControl
Sourcepub fn new(cfg: SharedConfig, config_path: PathBuf, vram_total_gb: f32) -> Self
pub fn new(cfg: SharedConfig, config_path: PathBuf, vram_total_gb: f32) -> Self
Handles with fresh flags for cfg stored at config_path.
Sourcepub fn status(&self, observers: &WorkerObservers, busy: bool) -> DaemonStatus
pub fn status(&self, observers: &WorkerObservers, busy: bool) -> DaemonStatus
The snapshot GET /daemon/status answers.
Sourcepub fn set_paused(&self, paused: bool) -> bool
pub fn set_paused(&self, paused: bool) -> bool
Pause or resume claiming studio jobs. Answers the new state.
Sourcepub fn editable_config(&self) -> EditableConfig
pub fn editable_config(&self) -> EditableConfig
The operator-editable config.
Sourcepub fn update_config(
&self,
edit: EditableConfig,
) -> Result<EditableConfig, ControlError>
pub fn update_config( &self, edit: EditableConfig, ) -> Result<EditableConfig, ControlError>
Validate edit, save it, then apply it to the running daemon.
Nothing changes when validation or the save fails.
Sourcepub fn request_registration_reset(&self) -> Result<(), ControlError>
pub fn request_registration_reset(&self) -> Result<(), ControlError>
Ask the daemon to clear a rejected registration and request again.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DaemonControl
impl !UnwindSafe for DaemonControl
impl Freeze for DaemonControl
impl Send for DaemonControl
impl Sync for DaemonControl
impl Unpin for DaemonControl
impl UnsafeUnpin for DaemonControl
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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> ⓘ
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 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> ⓘ
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