Struct carapax::types::InlineQuery
source · pub struct InlineQuery {
pub from: User,
pub id: String,
pub offset: String,
pub query: String,
pub chat_type: Option<InlineQueryChatType>,
pub location: Option<Location>,
}
Expand description
Represents an incoming inline query.
When the user sends an empty query, your bot could return some default or trending results.
Fields§
§from: User
Sender of the query.
id: String
Unique identifier of the query.
offset: String
Offset of the results to be returned, can be controlled by the bot.
query: String
Text of the query; up to 256 characters.
chat_type: Option<InlineQueryChatType>
Type of the chat, from which the inline query was sent.
Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat.
location: Option<Location>
Sender location, only for bots that request user location.
Implementations§
source§impl InlineQuery
impl InlineQuery
sourcepub fn new<A, B, C>(from: User, id: A, offset: B, query: C) -> InlineQuery
pub fn new<A, B, C>(from: User, id: A, offset: B, query: C) -> InlineQuery
Creates a new InlineQuery
.
§Arguments
from
- Sender of the query.id
- Unique identifier of the query.offset
- Offset of the results.query
- Text of the query; up to 256 characters.
sourcepub fn with_chat_type(self, value: InlineQueryChatType) -> InlineQuery
pub fn with_chat_type(self, value: InlineQueryChatType) -> InlineQuery
sourcepub fn with_location(self, value: Location) -> InlineQuery
pub fn with_location(self, value: Location) -> InlineQuery
Trait Implementations§
source§impl Clone for InlineQuery
impl Clone for InlineQuery
source§fn clone(&self) -> InlineQuery
fn clone(&self) -> InlineQuery
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 InlineQuery
impl Debug for InlineQuery
source§impl<'de> Deserialize<'de> for InlineQuery
impl<'de> Deserialize<'de> for InlineQuery
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<InlineQuery, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<InlineQuery, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for InlineQuery
impl PartialEq for InlineQuery
source§fn eq(&self, other: &InlineQuery) -> bool
fn eq(&self, other: &InlineQuery) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for InlineQuery
impl PartialOrd for InlineQuery
source§fn partial_cmp(&self, other: &InlineQuery) -> Option<Ordering>
fn partial_cmp(&self, other: &InlineQuery) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for InlineQuery
impl Serialize for InlineQuery
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,
Serialize this value into the given Serde serializer. Read more
source§impl TryFrom<Update> for InlineQuery
impl TryFrom<Update> for InlineQuery
§type Error = UnexpectedUpdate
type Error = UnexpectedUpdate
The type returned in the event of a conversion error.
source§fn try_from(
value: Update
) -> Result<InlineQuery, <InlineQuery as TryFrom<Update>>::Error>
fn try_from( value: Update ) -> Result<InlineQuery, <InlineQuery as TryFrom<Update>>::Error>
Performs the conversion.
source§impl TryFromInput for InlineQuery
impl TryFromInput for InlineQuery
§type Error = Infallible
type Error = Infallible
An error when conversion failed.
source§async fn try_from_input(
input: HandlerInput
) -> Result<Option<Self>, Self::Error>
async fn try_from_input( input: HandlerInput ) -> Result<Option<Self>, Self::Error>
Performs conversion. Read more
impl StructuralPartialEq for InlineQuery
Auto Trait Implementations§
impl Freeze for InlineQuery
impl RefUnwindSafe for InlineQuery
impl Send for InlineQuery
impl Sync for InlineQuery
impl Unpin for InlineQuery
impl UnwindSafe for InlineQuery
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> 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