pub struct Msg { /* private fields */ }Expand description
Push Notification Message
§Example
use bark::msg::Msg;
// new a simple message with title and body
let msg = Msg::new("title", "body");
// new a message with title = Notification and body
let mut msg = Msg::with_body("body");
// set some fields
msg.set_level("active");
msg.set_badge(1);
// and so onImplementations§
Source§impl Msg
impl Msg
pub fn new(title: &str, body: &str) -> Self
pub fn with_body(body: &str) -> Self
pub fn set_level(&mut self, level: &str) -> &mut Self
pub fn set_badge(&mut self, badge: u64) -> &mut Self
pub fn set_auto_copy(&mut self, auto_copy: u8) -> &mut Self
pub fn set_copy(&mut self, copy: &str) -> &mut Self
pub fn set_sound(&mut self, sound: &str) -> &mut Self
pub fn set_icon(&mut self, icon: &str) -> &mut Self
pub fn set_group(&mut self, group: &str) -> &mut Self
pub fn set_is_archive(&mut self, is_archive: u8) -> &mut Self
pub fn set_url(&mut self, url: &str) -> &mut Self
pub fn set_iv(&mut self, iv: &str) -> &mut Self
pub fn set_enc_type(&mut self, enc_type: &str) -> &mut Self
pub fn set_mode(&mut self, mode: &str) -> &mut Self
pub fn set_key(&mut self, key: &str) -> &mut Self
pub fn to_json(&self) -> String
pub fn encrypt(&self) -> Result<String, Box<dyn Error>>
pub fn serialize(&self) -> String
Auto Trait Implementations§
impl Freeze for Msg
impl RefUnwindSafe for Msg
impl Send for Msg
impl Sync for Msg
impl Unpin for Msg
impl UnwindSafe for Msg
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