Struct fcm::NotificationBuilder [−][src]
A builder to get a Notification
instance.
Examples
use fcm::NotificationBuilder; let mut builder = NotificationBuilder::new(); builder.body("3 runs to win in 1 ball"); let notification = builder.finalize();
Implementations
impl<'a> NotificationBuilder<'a>
[src]
pub fn new() -> NotificationBuilder<'a>
[src]
Get a new NotificationBuilder
instance, with a title.
pub fn title(&mut self, title: &'a str) -> &mut Self
[src]
pub fn body(&mut self, body: &'a str) -> &mut Self
[src]
Set the body of the notification
pub fn icon(&mut self, icon: &'a str) -> &mut Self
[src]
Set the notification icon.
pub fn sound(&mut self, sound: &'a str) -> &mut Self
[src]
Set the sound to be played
pub fn badge(&mut self, badge: &'a str) -> &mut Self
[src]
Set the badge for iOS notifications
pub fn tag(&mut self, tag: &'a str) -> &mut Self
[src]
Tagging a notification allows you to replace existing notifications with the same tag with this new notification
pub fn color(&mut self, color: &'a str) -> &mut Self
[src]
The color of the icon, in #rrggbb format
pub fn click_action(&mut self, click_action: &'a str) -> &mut Self
[src]
What happens when the user clicks on the notification. Refer to https://developers.google.com/cloud-messaging/http-server-ref#table2 for details.
pub fn body_loc_key(&mut self, body_loc_key: &'a str) -> &mut Self
[src]
Set the body key string for localization
pub fn body_loc_args<S>(&mut self, body_loc_args: &'a [S]) -> &mut Self where
S: Into<Cow<'a, str>> + AsRef<str>,
[src]
S: Into<Cow<'a, str>> + AsRef<str>,
String value to replace format specifiers in the body string.
pub fn title_loc_key(&mut self, title_loc_key: &'a str) -> &mut Self
[src]
Set the title key string for localization
pub fn title_loc_args<S>(&mut self, title_loc_args: &'a [S]) -> &mut Self where
S: Into<Cow<'a, str>> + AsRef<str>,
[src]
S: Into<Cow<'a, str>> + AsRef<str>,
String value to replace format specifiers in the title string.
pub fn finalize(self) -> Notification<'a>
[src]
Complete the build and get a Notification
instance
Trait Implementations
impl<'a> Default for NotificationBuilder<'a>
[src]
fn default() -> NotificationBuilder<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for NotificationBuilder<'a>
impl<'a> Send for NotificationBuilder<'a>
impl<'a> Sync for NotificationBuilder<'a>
impl<'a> Unpin for NotificationBuilder<'a>
impl<'a> UnwindSafe for NotificationBuilder<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,