pub struct Data {
pub db: Box<dyn MCDatabase>,
pub creds: Config,
pub captcha: SystemGroup,
pub mailer: Option<AsyncSmtpTransport<Tokio1Executor>>,
pub settings: Settings,
pub stats: Box<dyn Stats>,
pub survey_secrets: SecretsStore,
}
Expand description
App data
Fields§
§db: Box<dyn MCDatabase>
database ops defined by db crates
creds: Config
credential management configuration
captcha: SystemGroup
mCaptcha system: Redis cache, etc.
mailer: Option<AsyncSmtpTransport<Tokio1Executor>>
email client
settings: Settings
app settings
stats: Box<dyn Stats>
stats recorder
survey_secrets: SecretsStore
survey secret store
Implementations§
source§impl Data
impl Data
pub fn get_creds() -> Config
sourcepub async fn new(s: &Settings, survey_secrets: SecretsStore) -> Arc<Self>
pub async fn new(s: &Settings, survey_secrets: SecretsStore) -> Arc<Self>
create new instance of app data
fn get_mailer(s: &Settings) -> Option<AsyncSmtpTransport<Tokio1Executor>>
async fn upload_survey_job(&self) -> Result<(), ServiceError>
async fn register_survey(&self) -> Result<(), ServiceError>
Auto Trait Implementations§
impl !RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl !UnwindSafe for Data
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