mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-08 19:33:53 +01:00
Make UpdateFilterExt
and MessageFilterExt
sealed
This commit is contained in:
parent
d538c61b1c
commit
123ac1ec67
1 changed files with 10 additions and 1 deletions
|
@ -6,7 +6,7 @@ use teloxide_core::types::{Message, Update, UpdateKind};
|
|||
macro_rules! define_ext {
|
||||
($ext_name:ident, $for_ty:ty => $( ($func:ident, $proj_fn:expr, $fn_doc:expr) ,)*) => {
|
||||
#[doc = concat!("Filter methods for [`", stringify!($for_ty), "`].")]
|
||||
pub trait $ext_name<Out> {
|
||||
pub trait $ext_name<Out>: private::Sealed {
|
||||
$( define_ext!(@sig $func, $fn_doc); )*
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,15 @@ macro_rules! define_ext {
|
|||
};
|
||||
}
|
||||
|
||||
mod private {
|
||||
use teloxide_core::types::{Message, Update};
|
||||
|
||||
pub trait Sealed {}
|
||||
|
||||
impl Sealed for Update {}
|
||||
impl Sealed for Message {}
|
||||
}
|
||||
|
||||
macro_rules! define_message_ext {
|
||||
($( ($func:ident, $fn_name:path) ,)*) => {
|
||||
define_ext! {
|
||||
|
|
Loading…
Reference in a new issue