Struct cometd_client::CometdClientBuilder
source · pub struct CometdClientBuilder { /* private fields */ }Expand description
A builder to construct CometdClient.
Implementations§
source§impl CometdClientBuilder
impl CometdClientBuilder
sourcepub fn build(self) -> CometdResult<CometdClient>
pub fn build(self) -> CometdResult<CometdClient>
Return a CometdClient.
Example
use cometd_client::CometdClientBuilder;
let client = CometdClientBuilder::new()
.endpoint("http://[::1]:1025/notifications/")
.build()?;sourcepub fn endpoint(self, url: &'static str) -> Self
pub fn endpoint(self, url: &'static str) -> Self
Set cometd server endpoint.
Example
use cometd_client::CometdClientBuilder;
let app = CometdClientBuilder::new()
.endpoint("http://[::1]:1025/notifications/")
.build()?;sourcepub fn handshake_base_path(self, url: &'static str) -> Self
pub fn handshake_base_path(self, url: &'static str) -> Self
Set cometd server handshake url path.
Example
use cometd_client::CometdClientBuilder;
let app = CometdClientBuilder::new()
.handshake_base_path("hand/") // http://[::1]:1025/notifications/hand/handshake
.endpoint("http://[::1]:1025/notifications/")
.build()?;sourcepub fn subscribe_base_path(self, url: &'static str) -> Self
pub fn subscribe_base_path(self, url: &'static str) -> Self
Set cometd server subscribe url path.
Example
use cometd_client::CometdClientBuilder;
let app = CometdClientBuilder::new()
.subscribe_base_path("sub/") // http://[::1]:1025/notifications/sub/
.endpoint("http://[::1]:1025/notifications/")
.build()?;sourcepub fn connect_base_path(self, url: &'static str) -> Self
pub fn connect_base_path(self, url: &'static str) -> Self
Set cometd server connect url path.
Example
use cometd_client::CometdClientBuilder;
let app = CometdClientBuilder::new()
.connect_base_path("con/") // http://[::1]:1025/notifications/con/connect
.endpoint("http://[::1]:1025/notifications/")
.build()?;sourcepub fn disconnect_base_path(self, url: &'static str) -> Self
pub fn disconnect_base_path(self, url: &'static str) -> Self
Set cometd server disconnect url path.
Example
use cometd_client::CometdClientBuilder;
let app = CometdClientBuilder::new()
.connect_base_path("discon/") // http://[::1]:1025/notifications/discon/disconnect
.endpoint("http://[::1]:1025/notifications/")
.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.
Trait Implementations§
source§impl Debug for CometdClientBuilder
impl Debug for CometdClientBuilder
source§impl Default for CometdClientBuilder
impl Default for CometdClientBuilder
source§fn default() -> CometdClientBuilder
fn default() -> CometdClientBuilder
Returns the “default value” for a type. Read more