Struct carapax::handler::LongPollOptions
source · pub struct LongPollOptions { /* private fields */ }
Expand description
Represents options for configuring long polling behavior.
Implementations§
source§impl LongPollOptions
impl LongPollOptions
sourcepub fn with_allowed_update(self, value: AllowedUpdate) -> LongPollOptions
pub fn with_allowed_update(self, value: AllowedUpdate) -> LongPollOptions
Adds a type of updates that you want your bot to receive.
§Arguments
value
- A type of update to be allowed.
sourcepub fn with_error_timeout(self, value: u64) -> LongPollOptions
pub fn with_error_timeout(self, value: u64) -> LongPollOptions
Sets a new error timeout.
§Arguments
value
- Timeout in seconds when an error has occurred; default - 5.
sourcepub fn with_limit(self, value: i64) -> LongPollOptions
pub fn with_limit(self, value: i64) -> LongPollOptions
Sets a new limit for the number of updates to be retrieved.
§Arguments
value
- Limit of the number of updates to be retrieved; 1—100; default - 100.
sourcepub fn with_poll_timeout(self, value: Duration) -> LongPollOptions
pub fn with_poll_timeout(self, value: Duration) -> LongPollOptions
Sets a new timeout for long polling.
§Arguments
value
- Timeout for long polling in seconds; 0 - usual short polling; default - 10.
Should be positive, short polling should be used for testing purposes only.
Trait Implementations§
source§impl Clone for LongPollOptions
impl Clone for LongPollOptions
source§fn clone(&self) -> LongPollOptions
fn clone(&self) -> LongPollOptions
Returns a copy 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 LongPollOptions
impl Debug for LongPollOptions
source§impl Default for LongPollOptions
impl Default for LongPollOptions
source§fn default() -> LongPollOptions
fn default() -> LongPollOptions
Returns the “default value” for a type. Read more
source§impl PartialEq for LongPollOptions
impl PartialEq for LongPollOptions
source§fn eq(&self, other: &LongPollOptions) -> bool
fn eq(&self, other: &LongPollOptions) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for LongPollOptions
impl StructuralPartialEq for LongPollOptions
Auto Trait Implementations§
impl Freeze for LongPollOptions
impl RefUnwindSafe for LongPollOptions
impl Send for LongPollOptions
impl Sync for LongPollOptions
impl Unpin for LongPollOptions
impl UnwindSafe for LongPollOptions
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more