pub struct PushAllowlist { /* private fields */ }Expand description
The push services a phone may subscribe through (spec 3.3 §5.4): the browsers’ own, over https, never an IP address. A subscription to anything else is refused, so a wake-up never goes to a host the person did not choose by installing a browser.
§Example
use adk_surface::mobile::PushAllowlist;
let allow = PushAllowlist::default();
assert!(allow.allows("https://web.push.apple.com/QGu1…"));
assert!(!allow.allows("http://web.push.apple.com/QGu1…"));
assert!(!allow.allows("https://192.0.2.7/push"));
assert!(!allow.allows("https://push.example.com/push"));Implementations§
Source§impl PushAllowlist
impl PushAllowlist
Sourcepub fn new(hosts: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn new(hosts: impl IntoIterator<Item = impl Into<String>>) -> Self
These hosts, over https: fcm.googleapis.com names one host, *.push.apple.com every
host under that domain.
Sourcepub fn with_plain_http_to_localhost(self) -> Self
pub fn with_plain_http_to_localhost(self) -> Self
Also allows plain http to localhost, for tests against a local fake push service.
Never set it on a server people use.
Trait Implementations§
Source§impl Clone for PushAllowlist
impl Clone for PushAllowlist
Source§impl Debug for PushAllowlist
impl Debug for PushAllowlist
Source§impl Default for PushAllowlist
impl Default for PushAllowlist
impl Eq for PushAllowlist
Source§impl PartialEq for PushAllowlist
impl PartialEq for PushAllowlist
impl StructuralPartialEq for PushAllowlist
Auto Trait Implementations§
impl Forget for PushAllowlist
impl Freeze for PushAllowlist
impl Move for PushAllowlist
impl RefUnwindSafe for PushAllowlist
impl Send for PushAllowlistwhere
RawVecInner: Send,
impl Sync for PushAllowlistwhere
RawVecInner: Sync,
impl Unpin for PushAllowlist
impl UnsafeUnpin for PushAllowlist
impl UnwindSafe for PushAllowlistwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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