pub struct ApnsConfig { /* private fields */ }Expand description
Represents all settings for Apple notifications. See https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#apnsconfig.
Implementations§
Source§impl ApnsConfig
impl ApnsConfig
pub fn new() -> Self
Sourcepub fn headers(
&mut self,
headers: impl IntoFirebaseMap,
) -> Result<&mut Self, Error>
pub fn headers( &mut self, headers: impl IntoFirebaseMap, ) -> Result<&mut Self, Error>
Set the headers field. 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, ApnsConfig};
#[derive(AsFirebaseMap)]
struct ApnsHeaders {
field1: String,
field2: String,
}
fn main() {
let headers = ApnsHeaders {
field1: "Hello,".to_string(),
field2: "world!".to_string(),
};
let mut config = ApnsConfig::new();
config.headers(headers).expect("Data not parsable");
}Sourcepub fn payload(
&mut self,
payload: impl IntoFirebaseMap,
) -> Result<&mut Self, Error>
pub fn payload( &mut self, payload: impl IntoFirebaseMap, ) -> Result<&mut Self, Error>
Set the payload field. 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, ApnsConfig};
#[derive(AsFirebaseMap)]
struct ApnsPayload {
field1: String,
field2: String,
}
fn main() {
let payload = ApnsPayload {
field1: "Hello,".to_string(),
field2: "world!".to_string(),
};
let mut config = ApnsConfig::new();
config.payload(payload).expect("Data not parsable");
}pub fn fcm_options(&mut self, fcm_options: ApnsFcmOptions) -> &mut Self
Trait Implementations§
Source§impl Clone for ApnsConfig
impl Clone for ApnsConfig
Source§fn clone(&self) -> ApnsConfig
fn clone(&self) -> ApnsConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApnsConfig
impl Debug for ApnsConfig
Source§impl Default for ApnsConfig
impl Default for ApnsConfig
Source§fn default() -> ApnsConfig
fn default() -> ApnsConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ApnsConfig
impl RefUnwindSafe for ApnsConfig
impl Send for ApnsConfig
impl Sync for ApnsConfig
impl Unpin for ApnsConfig
impl UnwindSafe for ApnsConfig
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