pub(crate) struct DictateState {
pub(crate) snapshot: Mutex<DictateSnapshot>,
pub(crate) cancelled: AtomicBool,
pub(crate) engine: Mutex<Option<Arc<Engine>>>,
pub(crate) active: Mutex<Vec<(DictateRole, ActiveModel)>>,
}Expand description
Preflight’s own handle on the work: the snapshot a view renders, the cancellation flag, and the active models the resolution landed.
Fields§
§snapshot: Mutex<DictateSnapshot>§cancelled: AtomicBool§engine: Mutex<Option<Arc<Engine>>>The live engine, held for the whole run. Dropping it unloads the weights, which is the one thing preflight exists to avoid.
active: Mutex<Vec<(DictateRole, ActiveModel)>>Which model each role runs: the compiled pins until the preflight resolves, then whatever the config, the runtime pick or the pin answered.
Implementations§
Source§impl DictateState
impl DictateState
pub(crate) fn new(settings: &DictateSettings) -> Self
Sourcepub(crate) fn set_active(&self, models: &[(DictateRole, ActiveModel)])
pub(crate) fn set_active(&self, models: &[(DictateRole, ActiveModel)])
Move the resolved models in, before the preflight fetches anything: the rows follow the files the roles will actually run, keeping the state a row already reached when its file is unchanged.
fn set_state(&self, file: &str, state: DictateModelState)
Sourcepub(crate) fn mark_all(&self, state: &DictateModelState)
pub(crate) fn mark_all(&self, state: &DictateModelState)
Move every row to one state: preflight’s Loading and Ready points, and the same Ready after a runtime swap, where every role’s model is loaded by the engine that just came up.
pub(crate) fn fail(&self, failure: DictateFailure, file: Option<&str>)
Auto Trait Implementations§
impl !Freeze for DictateState
impl !RefUnwindSafe for DictateState
impl !UnwindSafe for DictateState
impl Send for DictateState
impl Sync for DictateState
impl Unpin for DictateState
impl UnsafeUnpin for DictateState
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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