[−][src]Struct dbq::SchemaConfig
Configures the tables for storing the job queue and dead letters. The
default SchemaConfig
uses the default schema and prefixes the tables with
dbq_
Examples
Default configuration
use dbq::*; let config = SchemaConfig::default(); assert_eq!("dbq_job_queue", config.queue_table()); assert_eq!("dbq_job_dead_letters", config.dead_letters_table());
Change the table prefix
use dbq::*; let config = SchemaConfig::new("my".to_string()); assert_eq!("my_job_queue", config.queue_table()); assert_eq!("my_job_dead_letters", config.dead_letters_table());
Remove the table prefix
use dbq::*; let config = SchemaConfig::new("".to_string()); assert_eq!("job_queue", config.queue_table()); assert_eq!("job_dead_letters", config.dead_letters_table());
Use a custom schema
use dbq::*; let mut config = SchemaConfig::new("".to_string()); config.set_schema(Some("jobs".to_string())); assert_eq!("jobs.job_queue", config.queue_table()); assert_eq!("jobs.job_dead_letters", config.dead_letters_table());
Methods
impl SchemaConfig
[src]
pub fn new(table_prefix: String) -> Self
[src]
pub fn schema(&self) -> &Option<String>
[src]
pub fn set_schema(&mut self, schema: Option<String>)
[src]
pub fn table_prefix(&self) -> &str
[src]
pub fn queue_table(&self) -> &str
[src]
pub fn dead_letters_table(&self) -> &str
[src]
Trait Implementations
impl Clone for SchemaConfig
[src]
fn clone(&self) -> SchemaConfig
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for SchemaConfig
[src]
impl Debug for SchemaConfig
[src]
Auto Trait Implementations
impl Send for SchemaConfig
impl Sync for SchemaConfig
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self