pub enum JobQueueWrapper {
Postgres(JobQueue<Postgres>),
MySQL(JobQueue<MySql>),
}Expand description
Wrapper for database-specific JobQueue implementations.
This enum provides a unified interface for working with job queues regardless of the underlying database type.
§Examples
use cargo_hammerwork::utils::database::{DatabasePool, JobQueueWrapper};
let pool = DatabasePool::connect("postgresql://localhost/hammerwork", 5).await?;
let job_queue = pool.create_job_queue();
// The wrapper handles database-specific operations internally
match job_queue {
JobQueueWrapper::Postgres(queue) => {
// PostgreSQL-specific operations
}
JobQueueWrapper::MySQL(queue) => {
// MySQL-specific operations
}
}Variants§
Auto Trait Implementations§
impl !RefUnwindSafe for JobQueueWrapper
impl !UnwindSafe for JobQueueWrapper
impl Freeze for JobQueueWrapper
impl Send for JobQueueWrapper
impl Sync for JobQueueWrapper
impl Unpin for JobQueueWrapper
impl UnsafeUnpin for JobQueueWrapper
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
Converts
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>
Converts
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 more