pub struct DeviceToken(/* private fields */);Expand description
A provider-issued device token.
A token addresses one app installation, so anyone holding it can send that
device a notification. Debug redacts it and there is no Display; read
it with DeviceToken::expose only where it leaves for the provider or the
store.
Implementations§
Source§impl DeviceToken
impl DeviceToken
Sourcepub fn new(token: impl Into<String>) -> Result<Self, PushValidationError>
pub fn new(token: impl Into<String>) -> Result<Self, PushValidationError>
Validates a token: 1 to MAX_DEVICE_TOKEN_LENGTH bytes of visible ASCII.
Trim the value before calling this; surrounding whitespace is rejected rather than silently removed.
§Errors
Returns PushValidationError::DeviceToken for any other value.
Trait Implementations§
Source§impl Clone for DeviceToken
impl Clone for DeviceToken
Source§impl Debug for DeviceToken
impl Debug for DeviceToken
impl Eq for DeviceToken
Source§impl Hash for DeviceToken
impl Hash for DeviceToken
Source§impl Ord for DeviceToken
impl Ord for DeviceToken
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for DeviceToken
impl PartialEq for DeviceToken
Source§impl PartialOrd for DeviceToken
impl PartialOrd for DeviceToken
impl StructuralPartialEq for DeviceToken
Auto Trait Implementations§
impl Freeze for DeviceToken
impl RefUnwindSafe for DeviceToken
impl Send for DeviceToken
impl Sync for DeviceToken
impl Unpin for DeviceToken
impl UnsafeUnpin for DeviceToken
impl UnwindSafe for DeviceToken
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.