pub struct Replica {
pub observers: WorkerObservers,
pub cfg: SharedConfig,
pub busy: Arc<AtomicBool>,
pub paused: Arc<AtomicBool>,
pub registration: SharedRegistration,
pub status: Arc<Mutex<Option<DaemonStatus>>>,
pub models: Arc<Mutex<Vec<ModelEntry>>>,
pub link: Arc<Mutex<LinkState>>,
pub selected_job: Arc<Mutex<Option<String>>>,
pub selected_log: Arc<Mutex<Option<(String, JobLog)>>>,
/* private fields */
}Expand description
The UI’s copy of the daemon’s state. Cheap to clone.
Fields§
§observers: WorkerObserversThe daemon’s observers, as the tabs read them.
cfg: SharedConfigThe daemon’s operator-editable config and worker id (no secrets).
busy: Arc<AtomicBool>§paused: Arc<AtomicBool>§registration: SharedRegistration§status: Arc<Mutex<Option<DaemonStatus>>>The last snapshot, whole.
models: Arc<Mutex<Vec<ModelEntry>>>§link: Arc<Mutex<LinkState>>§selected_job: Arc<Mutex<Option<String>>>The job whose log the UI shows; the poller keeps its log fresh.
selected_log: Arc<Mutex<Option<(String, JobLog)>>>Implementations§
Source§impl Replica
impl Replica
Sourcepub fn registered(&self) -> bool
pub fn registered(&self) -> bool
Whether the daemon is registered with the studio.
Sourcepub fn apply_status(&self, status: DaemonStatus)
pub fn apply_status(&self, status: DaemonStatus)
Mirror a snapshot into the replica.
Sourcepub fn missing_thumbnails(&self) -> Vec<String>
pub fn missing_thumbnails(&self) -> Vec<String>
Job ids whose thumbnail the daemon has and the replica lacks.
Sourcepub fn logs_after(&self) -> u64
pub fn logs_after(&self) -> u64
The sequence number to ask new log entries after.
Sourcepub fn apply_logs(&self, page: LogsPage)
pub fn apply_logs(&self, page: LogsPage)
Append a page of log entries; a page from a restarted daemon (its sequence number went backwards) replaces the ring.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Replica
impl !UnwindSafe for Replica
impl Freeze for Replica
impl Send for Replica
impl Sync for Replica
impl Unpin for Replica
impl UnsafeUnpin for Replica
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