pub enum WorkerModels {
Wildcard,
Single(Box<ModelCard>),
Multi(Vec<ModelCard>),
}Expand description
Models configuration for a worker.
Encodes the three real cases instead of relying on Vec semantics:
Wildcard— accepts any model (empty models list on the wire)Single— serves exactly one modelMulti— serves multiple distinct models (len >= 2)
Variants§
Wildcard
Worker accepts any model (e.g., external API without discovery).
Single(Box<ModelCard>)
Worker serves exactly one model (most common for local inference).
Multi(Vec<ModelCard>)
Worker serves multiple distinct models (len >= 2).
Implementations§
Source§impl WorkerModels
impl WorkerModels
Sourcepub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
Returns true if this is a wildcard (accepts any model).
Sourcepub fn primary(&self) -> Option<&ModelCard>
pub fn primary(&self) -> Option<&ModelCard>
Returns the primary model: Single → Some, Multi → first, Wildcard → None.
Sourcepub fn find(&self, id: &str) -> Option<&ModelCard>
pub fn find(&self, id: &str) -> Option<&ModelCard>
Find a model by ID (checks aliases via ModelCard::matches).
Trait Implementations§
Source§impl Clone for WorkerModels
impl Clone for WorkerModels
Source§fn clone(&self) -> WorkerModels
fn clone(&self) -> WorkerModels
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkerModels
impl Debug for WorkerModels
Source§impl Default for WorkerModels
impl Default for WorkerModels
Source§fn default() -> WorkerModels
fn default() -> WorkerModels
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for WorkerModels
Deserialize from Vec<ModelCard> for wire compatibility.
impl<'de> Deserialize<'de> for WorkerModels
Deserialize from Vec<ModelCard> for wire compatibility.
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for WorkerModels
JsonSchema: wire format is Vec<ModelCard>.
impl JsonSchema for WorkerModels
JsonSchema: wire format is Vec<ModelCard>.
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for WorkerModels
impl RefUnwindSafe for WorkerModels
impl Send for WorkerModels
impl Sync for WorkerModels
impl Unpin for WorkerModels
impl UnsafeUnpin for WorkerModels
impl UnwindSafe for WorkerModels
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