#[non_exhaustive]pub enum TelegramError {
Unauthorized,
Conflict,
RateLimited {
method: String,
retry_after: u64,
},
Refused {
method: String,
code: i64,
description: String,
},
Unreachable {
method: String,
reason: String,
},
InvalidResponse {
method: String,
reason: String,
},
}Expand description
Why the Telegram adapter could not talk to Telegram (spec 3.3 §5.3).
Never carries the bot token. Converts into AdkError with a surface.telegram.* code
and provider telegram.
§Example
use adk_surface::channels::TelegramError;
let error = TelegramError::Unauthorized;
assert_eq!(error.code(), "surface.telegram.unauthorized");
assert!(error.to_string().contains("TELEGRAM_BOT_TOKEN"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Telegram refused the bot token.
Conflict
Another process reads the bot’s updates, or the bot has a webhook.
RateLimited
Telegram asked the bot to slow down for longer than the adapter waits.
Fields
Refused
Telegram refused the call, such as a chat that blocked the bot.
Fields
Unreachable
Telegram could not be reached.
InvalidResponse
Telegram’s answer was not the Bot API’s JSON.
Implementations§
Trait Implementations§
Source§impl Clone for TelegramError
impl Clone for TelegramError
Source§impl Debug for TelegramError
impl Debug for TelegramError
Source§impl Display for TelegramError
impl Display for TelegramError
impl Eq for TelegramError
Source§impl Error for TelegramError
impl Error for TelegramError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<TelegramError> for AdkError
impl From<TelegramError> for AdkError
Source§fn from(error: TelegramError) -> Self
fn from(error: TelegramError) -> Self
Converts to this type from the input type.
Source§impl From<TelegramError> for KernelError
impl From<TelegramError> for KernelError
Source§fn from(error: TelegramError) -> Self
fn from(error: TelegramError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TelegramError
impl PartialEq for TelegramError
impl StructuralPartialEq for TelegramError
Auto Trait Implementations§
impl Forget for TelegramError
impl Freeze for TelegramError
impl Move for TelegramError
impl RefUnwindSafe for TelegramError
impl Send for TelegramErrorwhere
RawVecInner: Send,
impl Sync for TelegramErrorwhere
RawVecInner: Sync,
impl Unpin for TelegramError
impl UnsafeUnpin for TelegramError
impl UnwindSafe for TelegramErrorwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more