pub enum MockStreamResult {
Partials(Vec<PartialModelResponse>),
Error(LanguageModelError),
}Expand description
Result for a mocked stream call.
It can either be a set of partial responses or an error to return.
Variants§
Partials(Vec<PartialModelResponse>)
Error(LanguageModelError)
Implementations§
Source§impl MockStreamResult
impl MockStreamResult
Sourcepub fn partials(partials: Vec<PartialModelResponse>) -> Self
pub fn partials(partials: Vec<PartialModelResponse>) -> Self
Construct a result that yields the provided partial responses.
Sourcepub fn error(error: LanguageModelError) -> Self
pub fn error(error: LanguageModelError) -> Self
Construct a result that yields the provided error.
Trait Implementations§
Source§impl From<PartialModelResponse> for MockStreamResult
impl From<PartialModelResponse> for MockStreamResult
Source§fn from(partial: PartialModelResponse) -> Self
fn from(partial: PartialModelResponse) -> Self
Converts to this type from the input type.
Source§impl From<Result<Vec<PartialModelResponse>, LanguageModelError>> for MockStreamResult
impl From<Result<Vec<PartialModelResponse>, LanguageModelError>> for MockStreamResult
Source§fn from(result: LanguageModelResult<Vec<PartialModelResponse>>) -> Self
fn from(result: LanguageModelResult<Vec<PartialModelResponse>>) -> Self
Converts to this type from the input type.
Source§impl From<Vec<PartialModelResponse>> for MockStreamResult
impl From<Vec<PartialModelResponse>> for MockStreamResult
Source§fn from(partials: Vec<PartialModelResponse>) -> Self
fn from(partials: Vec<PartialModelResponse>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MockStreamResult
impl !RefUnwindSafe for MockStreamResult
impl Send for MockStreamResult
impl Sync for MockStreamResult
impl Unpin for MockStreamResult
impl !UnwindSafe for MockStreamResult
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