[][src]Trait push::communications::Connection

pub trait Connection {
    fn subscribe(
        &mut self,
        channel_id: &str,
        app_server_key: Option<&str>
    ) -> Result<RegisterResponse>;
fn unsubscribe(&self, channel_id: Option<&str>) -> Result<bool>;
fn update(&mut self, new_token: &str) -> Result<bool>;
fn channel_list(&self) -> Result<Vec<String>>;
fn verify_connection(&self, channels: &[String]) -> Result<bool>;
fn broadcast_subscribe(
        &self,
        broadcast: BroadcastValue
    ) -> Result<BroadcastValue>;
fn broadcasts(&self) -> Result<BroadcastValue>; }

A new communication link to the Autopush server

Required methods

fn subscribe(
    &mut self,
    channel_id: &str,
    app_server_key: Option<&str>
) -> Result<RegisterResponse>

send a new subscription request to the server, get back the server registration response.

fn unsubscribe(&self, channel_id: Option<&str>) -> Result<bool>

Drop an endpoint

fn update(&mut self, new_token: &str) -> Result<bool>

Update the autopush server with the new native OS Messaging authorization token

fn channel_list(&self) -> Result<Vec<String>>

Get a list of server known channels.

fn verify_connection(&self, channels: &[String]) -> Result<bool>

Verify that the known channel list matches up with the server list. If this fails, regenerate endpoints. This should be performed once a day.

fn broadcast_subscribe(
    &self,
    broadcast: BroadcastValue
) -> Result<BroadcastValue>

Add one or more new broadcast subscriptions.

fn broadcasts(&self) -> Result<BroadcastValue>

get the list of broadcasts

Loading content...

Implementors

impl Connection for ConnectHttp[src]

fn subscribe(
    &mut self,
    channel_id: &str,
    app_server_key: Option<&str>
) -> Result<RegisterResponse>
[src]

send a new subscription request to the server, get back the server registration response.

fn unsubscribe(&self, channel_id: Option<&str>) -> Result<bool>[src]

Drop a channel and stop receiving updates.

fn update(&mut self, new_token: &str) -> Result<bool>[src]

Update the push server with the new OS push authorization token

fn channel_list(&self) -> Result<Vec<String>>[src]

Get a list of server known channels. If it differs from what we have, reset the UAID, and refresh channels. Should be done once a day.

fn verify_connection(&self, channels: &[String]) -> Result<bool>[src]

Verify that the server and client both have matching channel information. A "false" should force the client to drop the old UAID, request a new UAID from the server, and resubscribe all channels, resulting in new endpoints.

Loading content...