pub struct State {
source: Source,
config: Mutex<Versioned>,
stats: Mutex<Stats>,
started: Instant,
}Fields§
§source: Source§config: Mutex<Versioned>§stats: Mutex<Stats>§started: InstantImplementations§
Source§impl State
impl State
pub(super) fn summary(&self) -> Result<Value>
pub(super) fn layers(&self, offset: usize, limit: usize) -> Result<Value>
pub(super) fn experts( &self, layer: usize, offset: usize, limit: usize, ) -> Result<Value>
fn activity_page<T: Serialize>( &self, query: impl FnOnce(&ExpertActivity) -> Result<T>, ) -> Result<Value>
pub fn new(source: Source, config: Config) -> Self
pub fn config(&self) -> Versioned
pub fn show_config(&self) -> Value
pub fn reload(&self) -> Result<Value>
pub fn update(&self, f: impl FnOnce(&mut Stats))
pub fn status(&self) -> Value
pub fn begin(&self)
pub fn current( &self, request_id: &str, generation: u64, phase: &'static str, tokens: usize, )
pub fn token(&self)
pub(crate) fn observe( &self, gpu: &Gpu<'_>, cache: &PrefixCache, spare: &mut ExpertActivity, )
Sourcepub(crate) fn publish_observation(
&self,
cache: CacheStats,
memory: MemoryStats,
spare: &mut ExpertActivity,
)
pub(crate) fn publish_observation( &self, cache: CacheStats, memory: MemoryStats, spare: &mut ExpertActivity, )
Swap complete snapshots while holding the lock; retain the old allocation as the worker’s spare so the next observation can reuse it.
Auto Trait Implementations§
impl !Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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