pub enum Error {
ModelNotAvailable,
DeviceNotEligible,
AppleIntelligenceNotEnabled,
ModelNotReady,
InvalidInput(String),
GenerationError(String),
Timeout(String),
ToolCall(ToolCallError),
InternalError(String),
PoisonError,
Json(String),
}Expand description
Error types for FoundationModels operations.
Variants§
ModelNotAvailable
Model is not available on this device.
DeviceNotEligible
Device is not eligible for Apple Intelligence.
AppleIntelligenceNotEnabled
Apple Intelligence is not enabled in system settings.
ModelNotReady
Model is not ready (downloading or other system reasons).
InvalidInput(String)
Invalid input provided (e.g., string contains null bytes).
GenerationError(String)
Error during generation.
Timeout(String)
Operation timed out.
ToolCall(ToolCallError)
Error during tool invocation.
InternalError(String)
Internal error in the FFI layer.
PoisonError
A lock was poisoned.
Json(String)
JSON serialization/deserialization error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl<T> From<PoisonError<T>> for Error
impl<T> From<PoisonError<T>> for Error
Source§fn from(_: StdPoisonError<T>) -> Self
fn from(_: StdPoisonError<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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