pub struct Client<CTXEXT, FENS, RTRVL> {
pub ensemble_fetcher: Arc<CachingFetcher<CTXEXT, FENS>>,
pub retrieval_client: Arc<RTRVL>,
pub _ctx_ext: PhantomData<CTXEXT>,
}Expand description
Client for ensemble operations.
Combines a caching fetcher for ensemble definitions with a retrieval client for listing and usage statistics.
Fields§
§ensemble_fetcher: Arc<CachingFetcher<CTXEXT, FENS>>Caching fetcher for ensemble definitions.
retrieval_client: Arc<RTRVL>Client for listing ensembles and getting usage.
_ctx_ext: PhantomData<CTXEXT>Phantom data for the context extension type.
Implementations§
Source§impl<CTXEXT, FENS, RTRVL> Client<CTXEXT, FENS, RTRVL>
impl<CTXEXT, FENS, RTRVL> Client<CTXEXT, FENS, RTRVL>
Sourcepub fn new(
ensemble_fetcher: Arc<CachingFetcher<CTXEXT, FENS>>,
retrieval_client: Arc<RTRVL>,
) -> Self
pub fn new( ensemble_fetcher: Arc<CachingFetcher<CTXEXT, FENS>>, retrieval_client: Arc<RTRVL>, ) -> Self
Creates a new ensemble client.
Source§impl<CTXEXT, FENS, RTRVL> Client<CTXEXT, FENS, RTRVL>
impl<CTXEXT, FENS, RTRVL> Client<CTXEXT, FENS, RTRVL>
Sourcepub async fn list(
&self,
ctx: Context<CTXEXT>,
) -> Result<ListEnsemble, ResponseError>
pub async fn list( &self, ctx: Context<CTXEXT>, ) -> Result<ListEnsemble, ResponseError>
Lists all ensembles.
Sourcepub async fn get(
&self,
ctx: Context<CTXEXT>,
id: &str,
) -> Result<GetEnsemble, ResponseError>
pub async fn get( &self, ctx: Context<CTXEXT>, id: &str, ) -> Result<GetEnsemble, ResponseError>
Retrieves an ensemble by its ID.
Returns a 404 error if the ensemble is not found.
Sourcepub async fn get_usage(
&self,
ctx: Context<CTXEXT>,
id: &str,
) -> Result<UsageEnsemble, ResponseError>
pub async fn get_usage( &self, ctx: Context<CTXEXT>, id: &str, ) -> Result<UsageEnsemble, ResponseError>
Retrieves usage statistics for an ensemble.
Auto Trait Implementations§
impl<CTXEXT, FENS, RTRVL> Freeze for Client<CTXEXT, FENS, RTRVL>
impl<CTXEXT, FENS, RTRVL> RefUnwindSafe for Client<CTXEXT, FENS, RTRVL>
impl<CTXEXT, FENS, RTRVL> Send for Client<CTXEXT, FENS, RTRVL>
impl<CTXEXT, FENS, RTRVL> Sync for Client<CTXEXT, FENS, RTRVL>
impl<CTXEXT, FENS, RTRVL> Unpin for Client<CTXEXT, FENS, RTRVL>where
CTXEXT: Unpin,
impl<CTXEXT, FENS, RTRVL> UnwindSafe for Client<CTXEXT, FENS, RTRVL>
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