Struct xpcom::interfaces::nsIPushService
[−]
[src]
#[repr(C)]pub struct nsIPushService { /* fields omitted */ }
interface nsIPushService : nsISupports
/**
* A service for components to subscribe and receive push messages from web
* services. This functionality is exposed to content via the Push DOM API,
* which uses service workers. This interface exists to support the DOM API,
* and allows privileged code to receive messages without migrating to service
* workers.
*/
Methods
impl nsIPushService
[src]
pub fn coerce<T: nsIPushServiceCoerce>(&self) -> &T
[src]
Cast this nsIPushService
to one of its base interfaces.
impl nsIPushService
[src]
pub unsafe fn GetPushTopic(&self, aPushTopic: &mut nsAString) -> nsresult
[src]
/** Observer topic names, exported for convenience. */
readonly attribute DOMString pushTopic;
pub unsafe fn GetSubscriptionChangeTopic(
&self,
aSubscriptionChangeTopic: &mut nsAString
) -> nsresult
[src]
&self,
aSubscriptionChangeTopic: &mut nsAString
) -> nsresult
readonly attribute DOMString subscriptionChangeTopic;
pub unsafe fn GetSubscriptionModifiedTopic(
&self,
aSubscriptionModifiedTopic: &mut nsAString
) -> nsresult
[src]
&self,
aSubscriptionModifiedTopic: &mut nsAString
) -> nsresult
readonly attribute DOMString subscriptionModifiedTopic;
pub unsafe fn Subscribe(
&self,
scope: &nsAString,
principal: *const nsIPrincipal,
callback: *const nsIPushSubscriptionCallback
) -> nsresult
[src]
&self,
scope: &nsAString,
principal: *const nsIPrincipal,
callback: *const nsIPushSubscriptionCallback
) -> nsresult
/**
* Creates a push subscription for the given |scope| URL and |principal|.
* If a subscription already exists for this |(scope, principal)| pair,
* the callback will receive the existing record as the second argument.
*
* The |endpoint| property of the subscription record is a URL string
* that can be used to send push messages to subscribers.
*
* Each incoming message fires a `push-message` observer notification, with
* an `nsIPushMessage` as the subject and the |scope| as the data.
*
* If the server drops a subscription, a `push-subscription-change` observer
* will be fired, with the subject set to |principal| and the data set to
* |scope|. Servers may drop subscriptions at any time, so callers should
* recreate subscriptions if desired.
*/
void subscribe (in DOMString scope, in nsIPrincipal principal, in nsIPushSubscriptionCallback callback);
pub unsafe fn SubscribeWithKey(
&self,
scope: &nsAString,
principal: *const nsIPrincipal,
keyLength: uint32_t,
key: *const uint8_t,
callback: *const nsIPushSubscriptionCallback
) -> nsresult
[src]
&self,
scope: &nsAString,
principal: *const nsIPrincipal,
keyLength: uint32_t,
key: *const uint8_t,
callback: *const nsIPushSubscriptionCallback
) -> nsresult
/**
* Creates a restricted push subscription with the given public |key|. The
* application server must use the corresponding private key to authenticate
* message delivery requests, as described in draft-thomson-webpush-vapid.
*/
void subscribeWithKey (in DOMString scope, in nsIPrincipal principal, in uint32_t keyLength, [array, size_is (keyLength), const] in uint8_t key, in nsIPushSubscriptionCallback callback);
pub unsafe fn Unsubscribe(
&self,
scope: &nsAString,
principal: *const nsIPrincipal,
callback: *const nsIUnsubscribeResultCallback
) -> nsresult
[src]
&self,
scope: &nsAString,
principal: *const nsIPrincipal,
callback: *const nsIUnsubscribeResultCallback
) -> nsresult
/**
* Removes a push subscription for the given |scope|.
*/
void unsubscribe (in DOMString scope, in nsIPrincipal principal, in nsIUnsubscribeResultCallback callback);
pub unsafe fn GetSubscription(
&self,
scope: &nsAString,
principal: *const nsIPrincipal,
callback: *const nsIPushSubscriptionCallback
) -> nsresult
[src]
&self,
scope: &nsAString,
principal: *const nsIPrincipal,
callback: *const nsIPushSubscriptionCallback
) -> nsresult
/**
* Retrieves the subscription record associated with the given
* |(scope, principal)| pair. If the subscription does not exist, the
* callback will receive |null| as the second argument.
*/
void getSubscription (in DOMString scope, in nsIPrincipal principal, in nsIPushSubscriptionCallback callback);
pub unsafe fn ClearForDomain(
&self,
domain: &nsAString,
callback: *const nsIPushClearResultCallback
) -> nsresult
[src]
&self,
domain: &nsAString,
callback: *const nsIPushClearResultCallback
) -> nsresult
/**
* Drops every subscription for the given |domain|, or all domains if
* |domain| is "*".
*/
void clearForDomain (in DOMString domain, in nsIPushClearResultCallback callback);
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIPushService
[src]
const IID: nsIID
IID: nsIID = nsID(1737422212, 48933, 18346, [172, 132, 3, 239, 192, 134, 91, 104])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIPushService
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIPushService
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.