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: Configcredential management configuration
captcha: SystemGroupmCaptcha system: Redis cache, etc.
mailer: Option<AsyncSmtpTransport<Tokio1Executor>>email client
settings: Settingsapp settings
stats: Box<dyn Stats>stats recorder
survey_secrets: SecretsStoresurvey 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 Freeze for Data
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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