pub struct StreamConfig {
pub url: String,
pub reconnect: ReconnectConfig,
pub heartbeat_interval: Duration,
pub buffer_size: usize,
}Expand description
Configuration for stream connection.
Fields§
§url: StringWebSocket URL
reconnect: ReconnectConfigReconnection settings
heartbeat_interval: DurationHeartbeat interval
buffer_size: usizeMessage buffer size
Implementations§
Source§impl StreamConfig
impl StreamConfig
Sourcepub fn new(url: impl Into<String>) -> StreamConfig
pub fn new(url: impl Into<String>) -> StreamConfig
Create with URL.
Sourcepub fn with_reconnect(self, config: ReconnectConfig) -> StreamConfig
pub fn with_reconnect(self, config: ReconnectConfig) -> StreamConfig
Set reconnection config.
Sourcepub fn with_heartbeat(self, interval: Duration) -> StreamConfig
pub fn with_heartbeat(self, interval: Duration) -> StreamConfig
Set heartbeat interval.
Sourcepub fn with_buffer_size(self, size: usize) -> StreamConfig
pub fn with_buffer_size(self, size: usize) -> StreamConfig
Set buffer size.
Trait Implementations§
Source§impl Clone for StreamConfig
impl Clone for StreamConfig
Source§fn clone(&self) -> StreamConfig
fn clone(&self) -> StreamConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamConfig
impl Debug for StreamConfig
Source§impl Default for StreamConfig
impl Default for StreamConfig
Source§fn default() -> StreamConfig
fn default() -> StreamConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StreamConfig
impl RefUnwindSafe for StreamConfig
impl Send for StreamConfig
impl Sync for StreamConfig
impl Unpin for StreamConfig
impl UnwindSafe for StreamConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().