summaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/app.rs b/src/app.rs
index 098ae9f..6261d34 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -19,18 +19,18 @@ use crate::{
#[derive(Clone)]
pub struct App<P> {
db: SqlitePool,
- webpush: P,
+ publisher: P,
events: event::Broadcaster,
token_events: token::Broadcaster,
}
impl<P> App<P> {
- pub fn from(db: SqlitePool, webpush: P) -> Self {
+ pub fn from(db: SqlitePool, publisher: P) -> Self {
let events = event::Broadcaster::default();
let token_events = token::Broadcaster::default();
Self {
db,
- webpush,
+ publisher,
events,
token_events,
}
@@ -62,11 +62,16 @@ impl<P> App<P> {
Messages::new(self.db.clone(), self.events.clone())
}
+ #[cfg(test)]
+ pub fn publisher(&self) -> &P {
+ &self.publisher
+ }
+
pub fn push(&self) -> Push<P>
where
P: Clone,
{
- Push::new(self.db.clone(), self.webpush.clone())
+ Push::new(self.db.clone(), self.publisher.clone())
}
pub fn setup(&self) -> Setup {
@@ -85,11 +90,6 @@ impl<P> App<P> {
pub fn vapid(&self) -> Vapid {
Vapid::new(self.db.clone(), self.events.clone())
}
-
- #[cfg(test)]
- pub fn webpush(&self) -> &P {
- &self.webpush
- }
}
impl<P> FromRef<App<P>> for Boot {