pub struct BufferedBodyDriver {
pub provider: &'static str,
/* private fields */
}Available on crate feature
test-utils and not (target_os=unknown and WebAssembly) only.Expand description
A buffered-body pipeline (the ChatGPT backend shape): the full SSE body is re-parsed after the fact and merged with the terminal response body.
Fields§
§provider: &'static strStable descriptor name of the provider under test.
Implementations§
Source§impl BufferedBodyDriver
impl BufferedBodyDriver
Sourcepub fn new(
provider: &'static str,
drive: impl Fn(String) -> BoxFuture<'static, Result<Vec<AssistantContent>, CompletionError>> + Send + Sync + 'static,
) -> Self
pub fn new( provider: &'static str, drive: impl Fn(String) -> BoxFuture<'static, Result<Vec<AssistantContent>, CompletionError>> + Send + Sync + 'static, ) -> Self
Wrap a buffered pipeline closure.
Sourcepub async fn drive(
&self,
body: String,
) -> Result<Vec<AssistantContent>, CompletionError>
pub async fn drive( &self, body: String, ) -> Result<Vec<AssistantContent>, CompletionError>
Run the buffered pipeline over a complete SSE body.
Auto Trait Implementations§
impl !RefUnwindSafe for BufferedBodyDriver
impl !UnwindSafe for BufferedBodyDriver
impl Freeze for BufferedBodyDriver
impl Send for BufferedBodyDriver
impl Sync for BufferedBodyDriver
impl Unpin for BufferedBodyDriver
impl UnsafeUnpin for BufferedBodyDriver
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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