Struct cometd_client::CometdClientBuilder
source · pub struct CometdClientBuilder<'b, 'c, 'd, 'e> { /* private fields */ }Expand description
A builder to construct CometdClient.
Implementations§
source§impl<'b, 'c, 'd, 'e> CometdClientBuilder<'b, 'c, 'd, 'e>
impl<'b, 'c, 'd, 'e> CometdClientBuilder<'b, 'c, 'd, 'e>
sourcepub fn build(self) -> CometdResult<CometdClient>
pub fn build(self) -> CometdResult<CometdClient>
Return a CometdClient.
Example
use cometd_client::CometdClientBuilder;
let client = CometdClientBuilder::new("http://[::1]:1025/notifications/".parse()?)
.build()?;sourcepub fn handshake_base_path(self, url: &'b str) -> Self
pub fn handshake_base_path(self, url: &'b str) -> Self
Set cometd server handshake url path.
Example
use cometd_client::CometdClientBuilder;
let app = CometdClientBuilder::new("http://[::1]:1025/notifications/".parse()?)
.handshake_base_path("hand/") // http://[::1]:1025/notifications/hand/handshake
.build()?;sourcepub fn subscribe_base_path(self, url: &'c str) -> Self
pub fn subscribe_base_path(self, url: &'c str) -> Self
Set cometd server subscribe url path.
Example
use cometd_client::CometdClientBuilder;
let app = CometdClientBuilder::new("http://[::1]:1025/notifications/".parse()?)
.subscribe_base_path("sub/") // http://[::1]:1025/notifications/sub/
.build()?;sourcepub fn connect_base_path(self, url: &'d str) -> Self
pub fn connect_base_path(self, url: &'d str) -> Self
Set cometd server connect url path.
Example
use cometd_client::CometdClientBuilder;
let app = CometdClientBuilder::new("http://[::1]:1025/notifications/".parse()?)
.connect_base_path("con/") // http://[::1]:1025/notifications/con/connect
.build()?;sourcepub fn disconnect_base_path(self, url: &'e str) -> Self
pub fn disconnect_base_path(self, url: &'e str) -> Self
Set cometd server disconnect url path.
Example
use cometd_client::CometdClientBuilder;
let app = CometdClientBuilder::new("http://[::1]:1025/notifications/".parse()?)
.connect_base_path("discon/") // http://[::1]:1025/notifications/discon/disconnect
.build()?;sourcepub fn timeout_ms(self, timeout_ms: u64) -> Self
pub fn timeout_ms(self, timeout_ms: u64) -> Self
Set timeout option in handshake request.
sourcepub fn interval_ms(self, interval_ms: u64) -> Self
pub fn interval_ms(self, interval_ms: u64) -> Self
Set interval option in handshake request.
sourcepub fn access_token<AT>(self, access_token: AT) -> Selfwhere
AT: AccessToken + 'static,
pub fn access_token<AT>(self, access_token: AT) -> Selfwhere
AT: AccessToken + 'static,
Set interval option in handshake request.