#[non_exhaustive]pub enum Error {
Setup(SetupError),
Net(NetError),
Service(ServiceError),
Stream(ActionError<Error>),
Auth(Error),
InvalidArgument(Box<dyn StdError + Send + Sync>),
InvalidContent(Box<dyn StdError + Send + Sync>),
}
Expand description
Unified error type for the Google Generative AI client
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.
Setup(SetupError)
Errors occurring during client setup/configuration
Net(NetError)
Network-level errors (transport failures, connection issues)
Service(ServiceError)
Service-level errors (API responses, business logic errors)
Stream(ActionError<Error>)
Streaming operation errors (both I/O and nested errors)
Auth(Error)
Configuration option errors
InvalidArgument(Box<dyn StdError + Send + Sync>)
Invalid parameter passed to API
InvalidContent(Box<dyn StdError + Send + Sync>)
Malformed or unsupported content structure
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + '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 From<ServiceError> for Error
impl From<ServiceError> for Error
Source§fn from(err: ServiceError) -> Self
fn from(err: ServiceError) -> 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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request