#[non_exhaustive]pub enum ExtractError {
MissingStructuredText {
mode: ExtractionMode,
provider: String,
},
MissingToolCall {
tool_name: String,
provider: String,
},
UnexpectedToolCallCount {
tool_name: String,
provider: String,
count: usize,
},
Unsupported {
mode: ExtractionMode,
provider: String,
},
ToolConflict {
mode: ExtractionMode,
provider: String,
},
Parse {
mode: ExtractionMode,
provider: String,
raw: String,
message: String,
},
}Expand description
Error produced while extracting structured output
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
MissingStructuredText
Structured text output was missing
Fields
§
mode: ExtractionModeExtraction mode that was attempted
MissingToolCall
Expected extraction tool call was missing
Fields
UnexpectedToolCallCount
Multiple extraction tool calls were returned when exactly one was expected
Fields
Unsupported
Requested extraction mode is unsupported
Fields
§
mode: ExtractionModeExtraction mode that was requested
ToolConflict
Extraction mode conflicted with the request shape
Fields
§
mode: ExtractionModeExtraction mode that was requested
Parse
Structured output could not be parsed
Implementations§
Source§impl ExtractError
impl ExtractError
Sourcepub fn raw_output(&self) -> Option<&str>
pub fn raw_output(&self) -> Option<&str>
Returns the raw unparsed output when available
Trait Implementations§
Source§impl Clone for ExtractError
impl Clone for ExtractError
Source§fn clone(&self) -> ExtractError
fn clone(&self) -> ExtractError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExtractError
impl Debug for ExtractError
Source§impl<'de> Deserialize<'de> for ExtractError
impl<'de> Deserialize<'de> for ExtractError
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ExtractError
impl Display for ExtractError
Source§impl Error for ExtractError
impl Error for ExtractError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ExtractError
impl RefUnwindSafe for ExtractError
impl Send for ExtractError
impl Sync for ExtractError
impl Unpin for ExtractError
impl UnsafeUnpin for ExtractError
impl UnwindSafe for ExtractError
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