pub enum Error {
Show 22 variants
InvalidPgUrl,
InvalidPgPackage,
WriteFileError(String),
ReadFileError(String),
DirCreationError(String),
UnpackFailure,
PgStartFailure,
PgStopFailure,
PgInitFailure,
PgCleanUpFailure(String),
PgPurgeFailure(String),
PgBufferReadError,
PgLockError,
PgProcessError,
PgTimedOutError,
PgTaskJoinError(String),
PgError(String, String),
DownloadFailure(String),
ConversionFailure(String),
SendFailure,
SqlQueryError(String),
MigrationError(String),
}Expand description
All errors that pg-embed can produce.
Every variant maps to a distinct failure mode in the library. Variants that
carry a String field contain a human-readable message from the underlying
OS or library call that caused the failure; this is always the .to_string()
of the original error.
Variants§
InvalidPgUrl
The download URL for PostgreSQL binaries could not be constructed.
Typically caused by the OS cache directory being unavailable or an unsupported platform combination.
InvalidPgPackage
The downloaded file is not a valid PostgreSQL binaries package.
Raised when the ZIP archive cannot be opened or does not contain the
expected .xz-compressed tarball.
WriteFileError(String)
A file write operation failed.
The inner string is the OS error message (e.g. Permission denied).
ReadFileError(String)
A file read or existence-check operation failed.
The inner string is the OS error message.
DirCreationError(String)
A directory could not be created.
The inner string is the OS error message.
UnpackFailure
XZ decompression or tar extraction of the PostgreSQL binaries failed.
PgStartFailure
pg_ctl start exited with a non-zero status.
PgStopFailure
pg_ctl stop exited with a non-zero status.
PgInitFailure
initdb exited with a non-zero status.
PgCleanUpFailure(String)
Removal of the database directory or password file failed.
The inner string is the OS error message.
PgPurgeFailure(String)
Removal of the cached binaries directory failed.
The inner string is the OS error message.
PgBufferReadError
A buffered I/O read from a process stream failed unexpectedly.
PgLockError
A mutex or async lock could not be acquired.
PgProcessError
Spawning or waiting on a child process failed.
PgTimedOutError
A pg_ctl or initdb call exceeded its configured timeout.
PgTaskJoinError(String)
A tokio::task::spawn_blocking join failed.
The inner string is the tokio::task::JoinError message.
PgError(String, String)
A generic error wrapper used internally to attach context.
The first field is the original error message; the second is a
human-readable context string (e.g. "spawn_blocking join error").
DownloadFailure(String)
The HTTP download of the PostgreSQL binaries JAR failed.
The inner string is the reqwest error message.
ConversionFailure(String)
Converting the HTTP response body to bytes failed.
The inner string is the reqwest error message.
SendFailure
An internal MPSC channel send failed because the receiver was dropped.
SqlQueryError(String)
A sqlx query or connection operation failed.
The inner string is the sqlx error message.
Only produced when the rt_tokio_migrate feature is enabled.
MigrationError(String)
Running sqlx migrations failed.
The inner string is the sqlx migrator error message.
Only produced when the rt_tokio_migrate feature is enabled.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl ProcessStatus<PgServerStatus, Error> for PgProcessType
impl ProcessStatus<PgServerStatus, Error> for PgProcessType
Source§fn status_entry(&self) -> PgServerStatus
fn status_entry(&self) -> PgServerStatus
Source§fn status_exit(&self) -> PgServerStatus
fn status_exit(&self) -> PgServerStatus
Source§fn error_type(&self) -> Error
fn error_type(&self) -> Error
Source§fn timeout_error(&self) -> Error
fn timeout_error(&self) -> Error
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.