pub struct AndroidConfig { /* private fields */ }
Expand description
Represents all settings for an Android message. See https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#AndroidConfig for a complete list.
Implementations§
Source§impl AndroidConfig
impl AndroidConfig
pub fn new() -> Self
pub fn collapse_key(&mut self, collapse_key: impl Into<String>) -> &mut Self
pub fn priority(&mut self, priority: AndroidMessagePriority) -> &mut Self
pub fn ttl(&mut self, seconds: usize) -> &mut Self
pub fn restricted_package_name( &mut self, restricted_package_name: impl Into<String>, ) -> &mut Self
Sourcepub fn data(&mut self, data: impl IntoFirebaseMap) -> Result<&mut Self, Error>
pub fn data(&mut self, data: impl IntoFirebaseMap) -> Result<&mut Self, Error>
Sets the data of the message. Accepts any type that implements IntoFirebaseMap, which will construct the required Map<String, String>. For ease, you can use the crate::AsFirebaseMap derive macro on your structs:
use firebae_cm::{AsFirebaseMap, AndroidConfig};
#[derive(AsFirebaseMap)]
struct Data {
field1: String,
field2: i32, // Note that this will become a String in Firebase
}
fn main() {
let data = Data {
field1: "Hello, world!".to_string(),
field2: 5481,
};
let mut config = AndroidConfig::new();
config.data(data).expect("Data not parsable");
}
pub fn notification(&mut self, notification: AndroidNotification) -> &mut Self
pub fn fcm_options(&mut self, fcm_options: AndroidFcmOptions) -> &mut Self
pub fn direct_boot_ok(&mut self, direct_boot_ok: bool) -> &mut Self
Trait Implementations§
Source§impl Clone for AndroidConfig
impl Clone for AndroidConfig
Source§fn clone(&self) -> AndroidConfig
fn clone(&self) -> AndroidConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AndroidConfig
impl Debug for AndroidConfig
Source§impl Default for AndroidConfig
impl Default for AndroidConfig
Source§fn default() -> AndroidConfig
fn default() -> AndroidConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AndroidConfig
impl RefUnwindSafe for AndroidConfig
impl Send for AndroidConfig
impl Sync for AndroidConfig
impl Unpin for AndroidConfig
impl UnwindSafe for AndroidConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more