Struct carapax::types::GetUpdates
source · pub struct GetUpdates { /* private fields */ }
Expand description
Returns incoming updates using long polling.
Implementations§
source§impl GetUpdates
impl GetUpdates
sourcepub fn add_allowed_update(self, value: AllowedUpdate) -> GetUpdates
pub fn add_allowed_update(self, value: AllowedUpdate) -> GetUpdates
sourcepub fn with_allowed_updates<T>(self, value: T) -> GetUpdateswhere
T: IntoIterator<Item = AllowedUpdate>,
pub fn with_allowed_updates<T>(self, value: T) -> GetUpdateswhere
T: IntoIterator<Item = AllowedUpdate>,
Sets a new list of allowed updates.
§Arguments
value
- List of the types of updates you want your bot to receive.
For example, specify [AllowedUpdate::Message, AllowedUpdate::EditedChannelPost]
to only receive updates of these types.
Specify an empty list to receive all updates regardless of type (default).
If not specified, the previous setting will be used.
Please note that this parameter doesn’t affect updates
created before the call to the method,
so unwanted updates may be received for a short period of time.
sourcepub fn with_limit(self, value: i64) -> GetUpdates
pub fn with_limit(self, value: i64) -> GetUpdates
Sets a new limit.
§Arguments
value
- Limit of the number of updates to be retrieved; 1—100; default - 100.
sourcepub fn with_offset(self, value: i64) -> GetUpdates
pub fn with_offset(self, value: i64) -> GetUpdates
Sets a new offset.
§Arguments
value
- Identifier of the first update to be returned.
Must be greater by one than the highest
among the identifiers of previously received updates.
By default, updates starting with the earliest unconfirmed update are returned.
An update is considered confirmed as soon as the method is called with
an offset higher than its update_id
.
The negative offset can be specified to retrieve updates starting
from -offset
update from the end of the updates queue.
All previous updates will forgotten.
sourcepub fn with_timeout(self, value: Duration) -> GetUpdates
pub fn with_timeout(self, value: Duration) -> GetUpdates
Sets a new timeout.
§Arguments
value
- Timeout for long polling; default - 0, i.e. usual short polling; should be positive; short polling should be used for testing purposes only.
Trait Implementations§
source§impl Clone for GetUpdates
impl Clone for GetUpdates
source§fn clone(&self) -> GetUpdates
fn clone(&self) -> GetUpdates
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GetUpdates
impl Debug for GetUpdates
source§impl Default for GetUpdates
impl Default for GetUpdates
source§fn default() -> GetUpdates
fn default() -> GetUpdates
source§impl Method for GetUpdates
impl Method for GetUpdates
source§impl Serialize for GetUpdates
impl Serialize for GetUpdates
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for GetUpdates
impl RefUnwindSafe for GetUpdates
impl Send for GetUpdates
impl Sync for GetUpdates
impl Unpin for GetUpdates
impl UnwindSafe for GetUpdates
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
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>
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>
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