pub struct SimplePush;
Expand description
A client for the simplepush.io API
See: https://simplepush.io/api for more details
Implementations§
Source§impl SimplePush
impl SimplePush
Sourcepub fn send(message: Message) -> Result<(), String>
pub fn send(message: Message) -> Result<(), String>
Sends a notification message through the simplepush.io API
Sending a notification
use simplepush_rs::{Message, SimplePush};
let _ = SimplePush::send(Message::new(
"SIMPLE_PUSH_KEY",
Some("title"),
"test message",
Some("alert"),
Some(vec!["yes", "no"]),
));
Sending a notification with encryption
use simplepush_rs::{Message, SimplePush};
let _ = SimplePush::send(Message::new_with_encryption(
"SIMPLE_PUSH_KEY",
Some("title"),
"test message",
Some("alert"),
Some(vec!["yes", "no"]),
"ENCRYPTION_KEY",
Some("SALT"),
));
Auto Trait Implementations§
impl Freeze for SimplePush
impl RefUnwindSafe for SimplePush
impl Send for SimplePush
impl Sync for SimplePush
impl Unpin for SimplePush
impl UnwindSafe for SimplePush
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