pub struct ModelCatalog { /* private fields */ }Expand description
In-memory model catalog (production would use etcd, Redis, etc.)
Implementations§
Source§impl ModelCatalog
impl ModelCatalog
pub fn new() -> Self
Sourcepub fn all_entries(&self) -> Vec<ModelEntry>
pub fn all_entries(&self) -> Vec<ModelEntry>
Get all entries (for debugging/admin)
Sourcepub fn get(&self, model_id: &ModelId) -> Option<ModelEntry>
pub fn get(&self, model_id: &ModelId) -> Option<ModelEntry>
Get entry by ID
Trait Implementations§
Source§impl Default for ModelCatalog
impl Default for ModelCatalog
Source§impl ModelCatalogTrait for ModelCatalog
impl ModelCatalogTrait for ModelCatalog
Source§fn register(
&self,
model_id: ModelId,
node_id: NodeId,
region_id: RegionId,
capabilities: Vec<Capability>,
) -> BoxFuture<'_, FederationResult<()>>
fn register( &self, model_id: ModelId, node_id: NodeId, region_id: RegionId, capabilities: Vec<Capability>, ) -> BoxFuture<'_, FederationResult<()>>
Register a model instance
Source§fn deregister(
&self,
model_id: ModelId,
node_id: NodeId,
) -> BoxFuture<'_, FederationResult<()>>
fn deregister( &self, model_id: ModelId, node_id: NodeId, ) -> BoxFuture<'_, FederationResult<()>>
Deregister a model instance
Source§fn find_by_capability(
&self,
capability: &Capability,
) -> BoxFuture<'_, FederationResult<Vec<(NodeId, RegionId)>>>
fn find_by_capability( &self, capability: &Capability, ) -> BoxFuture<'_, FederationResult<Vec<(NodeId, RegionId)>>>
Find nodes with a specific capability
Source§fn list_all(&self) -> BoxFuture<'_, FederationResult<Vec<ModelId>>>
fn list_all(&self) -> BoxFuture<'_, FederationResult<Vec<ModelId>>>
List all registered models
Source§fn get_metadata(
&self,
model_id: &ModelId,
) -> BoxFuture<'_, FederationResult<ModelMetadata>>
fn get_metadata( &self, model_id: &ModelId, ) -> BoxFuture<'_, FederationResult<ModelMetadata>>
Get model metadata
Auto Trait Implementations§
impl !Freeze for ModelCatalog
impl RefUnwindSafe for ModelCatalog
impl Send for ModelCatalog
impl Sync for ModelCatalog
impl Unpin for ModelCatalog
impl UnwindSafe for ModelCatalog
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
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