mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-11 04:21:12 +01:00
Un-seal MultipartPayload
This commit is contained in:
parent
dad5d5d4b1
commit
c92190e313
2 changed files with 3 additions and 12 deletions
|
@ -389,7 +389,6 @@ macro_rules! impl_payload {
|
|||
};
|
||||
(@[multipart] $Method:ident req { $($reqf:ident),* } opt { $($optf:ident),*} ) => {
|
||||
impl crate::requests::MultipartPayload for $Method {}
|
||||
impl crate::requests::multipart_payload::sealed::Sealed for $Method {}
|
||||
};
|
||||
(@[] $($ignored:tt)*) => {}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
use crate::{payloads, requests::Payload};
|
||||
|
||||
/// This is a future proof trait. It is `sealed` and can change at any time.
|
||||
pub trait MultipartPayload: Payload + sealed::Sealed {}
|
||||
/// Payloads that need to be sent as `multipart/form-data` because they contain
|
||||
/// files inside.
|
||||
pub trait MultipartPayload: Payload {}
|
||||
|
||||
// HACK(waffle): Sealed trait allows us to change `MultipartPayload` without
|
||||
// breaking changes & refactor multipart requests later.
|
||||
pub(crate) mod sealed {
|
||||
pub trait Sealed {}
|
||||
}
|
||||
|
||||
impl sealed::Sealed for payloads::SendMediaGroup {}
|
||||
impl MultipartPayload for payloads::SendMediaGroup {}
|
||||
|
||||
impl sealed::Sealed for payloads::EditMessageMedia {}
|
||||
impl MultipartPayload for payloads::EditMessageMedia {}
|
||||
|
||||
impl sealed::Sealed for payloads::EditMessageMediaInline {}
|
||||
impl MultipartPayload for payloads::EditMessageMediaInline {}
|
||||
|
|
Loading…
Reference in a new issue