#[non_exhaustive]pub enum ConnectionError {
InvalidCString(NulError),
BadConnection(String),
InvalidConnectionUrl(String),
CouldntSetupConfiguration(Error),
}
Expand description
Errors which can occur during Connection::establish
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.
InvalidCString(NulError)
The connection URL contained a NUL
byte.
BadConnection(String)
The database returned an error.
InvalidConnectionUrl(String)
The connection URL could not be parsed.
CouldntSetupConfiguration(Error)
Diesel could not configure the database connection.
Diesel may try to automatically set session specific configuration
values, such as UTF8 encoding, or enabling the ||
operator on MySQL.
This variant is returned if an error occurred executing the query to set
those options. Diesel will never affect global configuration.
Trait Implementations§
Source§impl Debug for ConnectionError
impl Debug for ConnectionError
Source§impl Display for ConnectionError
impl Display for ConnectionError
Source§impl Error for ConnectionError
impl Error for ConnectionError
Source§fn cause(&self) -> Option<&dyn StdError>
fn cause(&self) -> Option<&dyn StdError>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
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()
Source§impl From<NulError> for ConnectionError
impl From<NulError> for ConnectionError
Source§impl PartialEq for ConnectionError
impl PartialEq for ConnectionError
impl StructuralPartialEq for ConnectionError
Auto Trait Implementations§
impl Freeze for ConnectionError
impl !RefUnwindSafe for ConnectionError
impl Send for ConnectionError
impl Sync for ConnectionError
impl Unpin for ConnectionError
impl !UnwindSafe for ConnectionError
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.