[−][src]Enum tbot::types::parameters::CallbackAction
Represent possible actions for AnswerCallbackQuery
.
Though you can consturct variants directly, there are convenient methods
to do that: none
, notification
, alert
, url
.
Variants
No action.
Show text to the user. The last item configures show_alert
.
Url(&'a str)
Open a URL.
Methods
impl<'a> CallbackAction<'a>
[src]
pub fn is_none(&self) -> bool
[src]
Returns true
if self
is of variant None
.
pub fn is_text(&self) -> bool
[src]
Returns true
if self
is of variant Text
.
pub fn expect_text(self) -> (&'a str, bool) where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Text
.
Panics
Panics if the value is not Text
, with a panic message including the content of self
.
pub fn text(self) -> Option<(&'a str, bool)>
[src]
Returns Some
if self
is of variant Text
, and None
otherwise.
pub fn is_url(&self) -> bool
[src]
Returns true
if self
is of variant Url
.
pub fn expect_url(self) -> &'a str where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Url
.
Panics
Panics if the value is not Url
, with a panic message including the content of self
.
pub fn url(self) -> Option<&'a str>
[src]
Returns Some
if self
is of variant Url
, and None
otherwise.
impl<'a> CallbackAction<'a>
[src]
pub const fn with_no_action() -> Self
[src]
Constructs the None
variant.
pub fn with_notification(text: &'a str) -> Self
[src]
Constructs the Text
variant that shows a simple notification.
pub fn with_alert(text: &'a str) -> Self
[src]
Constructs the Text
variant that shows an alert.
pub fn with_url(url: &'a str) -> Self
[src]
Constructs the Url
variant.
Trait Implementations
impl<'a> Clone for CallbackAction<'a>
[src]
fn clone(&self) -> CallbackAction<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Copy for CallbackAction<'a>
[src]
impl<'a> Debug for CallbackAction<'a>
[src]
impl<'a> Eq for CallbackAction<'a>
[src]
impl<'a> Hash for CallbackAction<'a>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> PartialEq<CallbackAction<'a>> for CallbackAction<'a>
[src]
fn eq(&self, other: &CallbackAction<'a>) -> bool
[src]
fn ne(&self, other: &CallbackAction<'a>) -> bool
[src]
impl<'a> StructuralEq for CallbackAction<'a>
[src]
impl<'a> StructuralPartialEq for CallbackAction<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for CallbackAction<'a>
impl<'a> Send for CallbackAction<'a>
impl<'a> Sync for CallbackAction<'a>
impl<'a> Unpin for CallbackAction<'a>
impl<'a> UnwindSafe for CallbackAction<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,