conduwuit/src/service/pusher/data.rs

17 lines
464 B
Rust
Raw Normal View History

2022-10-05 20:34:31 +02:00
use ruma::{
api::client::push::{set_pusher, Pusher},
UserId,
2022-10-05 20:34:31 +02:00
};
use crate::Result;
pub(crate) trait Data: Send + Sync {
fn set_pusher(&self, sender: &UserId, pusher: set_pusher::v3::PusherAction) -> Result<()>;
fn get_pusher(&self, sender: &UserId, pushkey: &str) -> Result<Option<Pusher>>;
2021-06-08 18:10:00 +02:00
fn get_pushers(&self, sender: &UserId) -> Result<Vec<Pusher>>;
fn get_pushkeys<'a>(&'a self, sender: &UserId) -> Box<dyn Iterator<Item = Result<String>> + 'a>;
}