pub struct PushClient { /* private fields */ }Expand description
Client for push notification operations.
Implementations§
Source§impl PushClient
impl PushClient
Sourcepub async fn send(
&self,
user_id: &str,
payload: &Value,
) -> Result<PushResult, Error>
pub async fn send( &self, user_id: &str, payload: &Value, ) -> Result<PushResult, Error>
Send a push notification to a single user’s devices.
Sourcepub async fn send_many(
&self,
user_ids: &[&str],
payload: &Value,
) -> Result<PushResult, Error>
pub async fn send_many( &self, user_ids: &[&str], payload: &Value, ) -> Result<PushResult, Error>
Send a push notification to multiple users (no limit — server chunks internally).
Sourcepub async fn send_to_token(
&self,
token: &str,
payload: &Value,
platform: Option<&str>,
) -> Result<PushResult, Error>
pub async fn send_to_token( &self, token: &str, payload: &Value, platform: Option<&str>, ) -> Result<PushResult, Error>
Send a push notification to a specific device token.
Sourcepub async fn get_tokens(&self, user_id: &str) -> Result<Vec<Value>, Error>
pub async fn get_tokens(&self, user_id: &str) -> Result<Vec<Value>, Error>
Get registered device tokens for a user — token values NOT exposed.
Sourcepub async fn get_logs(
&self,
user_id: &str,
limit: Option<u32>,
) -> Result<Vec<Value>, Error>
pub async fn get_logs( &self, user_id: &str, limit: Option<u32>, ) -> Result<Vec<Value>, Error>
Get push send logs for a user (last 24 hours).
Auto Trait Implementations§
impl Freeze for PushClient
impl !RefUnwindSafe for PushClient
impl Send for PushClient
impl Sync for PushClient
impl Unpin for PushClient
impl UnsafeUnpin for PushClient
impl !UnwindSafe for PushClient
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