pub struct ModelGenerationPool {
pub identity: ExecutionIdentityV1,
pub max_concurrency: NonZeroUsize,
}Expand description
Digest-only provider/model capacity metadata.
The pool is intentionally a descriptor, not an executor or semaphore. Its identity binds the non-secret routing facts that share a provider capacity budget; the scheduler or a local admission gate owns the live reservation.
Fields§
§identity: ExecutionIdentityV1Domain-separated digest of provider, model, endpoint origin, and optional non-secret account scope.
max_concurrency: NonZeroUsizeMaximum active generations for this pool.
Implementations§
Source§impl ModelGenerationPool
impl ModelGenerationPool
Sourcepub fn new(
identity: ExecutionIdentityV1,
max_concurrency: NonZeroUsize,
) -> Result<Self, ModelGenerationPoolError>
pub fn new( identity: ExecutionIdentityV1, max_concurrency: NonZeroUsize, ) -> Result<Self, ModelGenerationPoolError>
Build a pool from an already-derived identity.
Sourcepub fn for_client(
provider: &str,
model: &str,
endpoint: Option<&str>,
account_id: Option<&str>,
concurrency: ModelGenerationConcurrency,
) -> Result<Self, ModelGenerationPoolError>
pub fn for_client( provider: &str, model: &str, endpoint: Option<&str>, account_id: Option<&str>, concurrency: ModelGenerationConcurrency, ) -> Result<Self, ModelGenerationPoolError>
Derive a stable pool from non-secret provider routing metadata.
Endpoint paths, queries, fragments, and credentials are deliberately discarded. Two clients that address the same origin/model therefore share one capacity key even when their API path configuration differs.
Sourcepub fn for_endpoint(
provider: &str,
model: &str,
endpoint: &str,
concurrency: ModelGenerationConcurrency,
) -> Result<Self, ModelGenerationPoolError>
pub fn for_endpoint( provider: &str, model: &str, endpoint: &str, concurrency: ModelGenerationConcurrency, ) -> Result<Self, ModelGenerationPoolError>
Convenience constructor for clients with a concrete endpoint URL.
Sourcepub fn for_account_endpoint(
provider: &str,
model: &str,
endpoint: &str,
account_id: &str,
concurrency: ModelGenerationConcurrency,
) -> Result<Self, ModelGenerationPoolError>
pub fn for_account_endpoint( provider: &str, model: &str, endpoint: &str, account_id: &str, concurrency: ModelGenerationConcurrency, ) -> Result<Self, ModelGenerationPoolError>
Convenience constructor for account-scoped clients.
pub fn identity(&self) -> &ExecutionIdentityV1
pub const fn max_concurrency(&self) -> NonZeroUsize
pub fn validate(&self) -> Result<(), ModelGenerationPoolError>
Trait Implementations§
Source§impl Clone for ModelGenerationPool
impl Clone for ModelGenerationPool
Source§fn clone(&self) -> ModelGenerationPool
fn clone(&self) -> ModelGenerationPool
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelGenerationPool
impl Debug for ModelGenerationPool
Source§impl<'de> Deserialize<'de> for ModelGenerationPool
impl<'de> Deserialize<'de> for ModelGenerationPool
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ModelGenerationPool
Source§impl PartialEq for ModelGenerationPool
impl PartialEq for ModelGenerationPool
Source§impl Serialize for ModelGenerationPool
impl Serialize for ModelGenerationPool
impl StructuralPartialEq for ModelGenerationPool
Auto Trait Implementations§
impl Freeze for ModelGenerationPool
impl RefUnwindSafe for ModelGenerationPool
impl Send for ModelGenerationPool
impl Sync for ModelGenerationPool
impl Unpin for ModelGenerationPool
impl UnsafeUnpin for ModelGenerationPool
impl UnwindSafe for ModelGenerationPool
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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