pub struct CometdClientBuilder<'a, 'b, 'c, 'd, 'e> { /* private fields */ }Expand description
A builder to construct CometdClient.
Implementations§
Source§impl<'a, 'b, 'c, 'd, 'e> CometdClientBuilder<'a, 'b, 'c, 'd, 'e>
impl<'a, 'b, 'c, 'd, 'e> CometdClientBuilder<'a, 'b, 'c, 'd, 'e>
Sourcepub fn build<Msg>(self) -> CometdResult<CometdClient<Msg>>
pub fn build<Msg>(self) -> CometdResult<CometdClient<Msg>>
Return a CometdClient.
§Example
let client = CometdClientBuilder::new(&"http://[::1]:1025/notifications/".parse()?)
.build()?;Sourcepub const fn handshake_base_path(self, url: &'b str) -> Self
pub const fn handshake_base_path(self, url: &'b str) -> Self
Set cometd server handshake url path.
§Example
let client = CometdClientBuilder::new(&"http://[::1]:1025/notifications/".parse()?)
.handshake_base_path("hand/") // http://[::1]:1025/notifications/hand/handshake
.build()?;Sourcepub const fn subscribe_base_path(self, url: &'c str) -> Self
pub const fn subscribe_base_path(self, url: &'c str) -> Self
Set cometd server subscribe url path.
§Example
let client = CometdClientBuilder::new(&"http://[::1]:1025/notifications/".parse()?)
.subscribe_base_path("sub/") // http://[::1]:1025/notifications/sub/
.build()?;Sourcepub const fn connect_base_path(self, url: &'d str) -> Self
pub const fn connect_base_path(self, url: &'d str) -> Self
Set cometd server connect url path.
§Example
let client = CometdClientBuilder::new(&"http://[::1]:1025/notifications/".parse()?)
.connect_base_path("con/") // http://[::1]:1025/notifications/con/connect
.build()?;Sourcepub const fn disconnect_base_path(self, url: &'e str) -> Self
pub const fn disconnect_base_path(self, url: &'e str) -> Self
Set cometd server disconnect url path.
§Example
let client = CometdClientBuilder::new(&"http://[::1]:1025/notifications/".parse()?)
.disconnect_base_path("con/") // http://[::1]:1025/notifications/discon/disconnect
.build()?;Sourcepub const fn interval(self, interval: Duration) -> Self
pub const fn interval(self, interval: Duration) -> Self
Set interval option in handshake request.
Sourcepub fn access_token(self, access_token: impl AccessToken) -> Self
pub fn access_token(self, access_token: impl AccessToken) -> Self
Set access token option in handshake request.
Set cookie.
Set cookies.
Sourcepub const fn events_channel_capacity(
self,
events_channel_capacity: usize,
) -> Self
pub const fn events_channel_capacity( self, events_channel_capacity: usize, ) -> Self
Set capacity of Event channel.
Sourcepub const fn commands_channel_capacity(
self,
commands_channel_capacity: usize,
) -> Self
pub const fn commands_channel_capacity( self, commands_channel_capacity: usize, ) -> Self
Set capacity of internal commands channel.
Sourcepub const fn number_of_retries(self, number_of_retries: usize) -> Self
pub const fn number_of_retries(self, number_of_retries: usize) -> Self
Set number of retries for requests.
Sourcepub const fn request_timeout(self, request_timeout: Duration) -> Self
pub const fn request_timeout(self, request_timeout: Duration) -> Self
Set requests timeout.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'b, 'c, 'd, 'e> Freeze for CometdClientBuilder<'a, 'b, 'c, 'd, 'e>
impl<'a, 'b, 'c, 'd, 'e> !RefUnwindSafe for CometdClientBuilder<'a, 'b, 'c, 'd, 'e>
impl<'a, 'b, 'c, 'd, 'e> Send for CometdClientBuilder<'a, 'b, 'c, 'd, 'e>
impl<'a, 'b, 'c, 'd, 'e> Sync for CometdClientBuilder<'a, 'b, 'c, 'd, 'e>
impl<'a, 'b, 'c, 'd, 'e> Unpin for CometdClientBuilder<'a, 'b, 'c, 'd, 'e>
impl<'a, 'b, 'c, 'd, 'e> !UnwindSafe for CometdClientBuilder<'a, 'b, 'c, 'd, 'e>
Blanket Implementations§
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