pub struct RoundRobinRouter { /* private fields */ }Expand description
Router that selects providers using round-robin order.
Implementations§
Source§impl RoundRobinRouter
impl RoundRobinRouter
Sourcepub fn provider_count(&self) -> usize
pub fn provider_count(&self) -> usize
Return the number of configured providers.
Sourcepub async fn complete(
&self,
request: &CompletionRequest,
) -> Result<CompletionResponse>
pub async fn complete( &self, request: &CompletionRequest, ) -> Result<CompletionResponse>
Execute a completion request using round-robin provider selection.
Sourcepub async fn stream(
&self,
request: &CompletionRequest,
) -> Result<Box<dyn Stream<Item = Result<CompletionChunk>> + Send + Unpin>>
pub async fn stream( &self, request: &CompletionRequest, ) -> Result<Box<dyn Stream<Item = Result<CompletionChunk>> + Send + Unpin>>
Execute a streaming request using round-robin provider selection.
Auto Trait Implementations§
impl !Freeze for RoundRobinRouter
impl !RefUnwindSafe for RoundRobinRouter
impl Send for RoundRobinRouter
impl Sync for RoundRobinRouter
impl Unpin for RoundRobinRouter
impl !UnwindSafe for RoundRobinRouter
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