Struct teloxide_tests::MockMessageAudio
source · pub struct MockMessageAudio {Show 27 fields
pub id: MessageId,
pub thread_id: Option<i32>,
pub date: DateTime<Utc>,
pub chat: Chat,
pub via_bot: Option<User>,
pub from: Option<User>,
pub sender_chat: Option<Chat>,
pub author_signature: Option<String>,
pub forward: Option<Forward>,
pub reply_to_message: Option<Box<Message>>,
pub edit_date: Option<DateTime<Utc>>,
pub reply_markup: Option<InlineKeyboardMarkup>,
pub is_topic_message: bool,
pub is_automatic_forward: bool,
pub has_protected_content: bool,
pub caption: Option<String>,
pub caption_entities: Vec<MessageEntity>,
pub media_group_id: Option<String>,
pub duration: u32,
pub performer: Option<String>,
pub title: Option<String>,
pub thumb: Option<PhotoSize>,
pub file_name: Option<String>,
pub mime_type: Option<Mime>,
pub file_id: String,
pub file_unique_id: String,
pub file_size: u32,
}Fields§
§id: MessageId§thread_id: Option<i32>§date: DateTime<Utc>§chat: Chat§via_bot: Option<User>§from: Option<User>§sender_chat: Option<Chat>§forward: Option<Forward>§reply_to_message: Option<Box<Message>>§edit_date: Option<DateTime<Utc>>§reply_markup: Option<InlineKeyboardMarkup>§is_topic_message: bool§is_automatic_forward: bool§has_protected_content: bool§caption: Option<String>§caption_entities: Vec<MessageEntity>§media_group_id: Option<String>§duration: u32§performer: Option<String>§title: Option<String>§thumb: Option<PhotoSize>§file_name: Option<String>§mime_type: Option<Mime>§file_id: String§file_unique_id: String§file_size: u32Implementations§
source§impl MockMessageAudio
impl MockMessageAudio
sourcepub fn id(self, value: i32) -> Self
pub fn id(self, value: i32) -> Self
Sets the id value of the MockMessageAudio to value, converting it to MessageId.
§Example
use teloxide_tests::MockMessageAudio;
let builder = MockMessageAudio::new().id(1234);
assert_eq!(builder.id, teloxide::types::MessageId(1234));sourcepub fn thread_id<T: Into<i32>>(self, value: T) -> Self
pub fn thread_id<T: Into<i32>>(self, value: T) -> Self
Sets the thread_id value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn date(self, value: DateTime<Utc>) -> Self
pub fn date(self, value: DateTime<Utc>) -> Self
Sets the date value of the MockMessageAudio to value.
sourcepub fn via_bot<T: Into<User>>(self, value: T) -> Self
pub fn via_bot<T: Into<User>>(self, value: T) -> Self
Sets the via_bot value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn from<T: Into<User>>(self, value: T) -> Self
pub fn from<T: Into<User>>(self, value: T) -> Self
Sets the from value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn sender_chat<T: Into<Chat>>(self, value: T) -> Self
pub fn sender_chat<T: Into<Chat>>(self, value: T) -> Self
Sets the sender_chat value of the MockMessageAudio to value, converting it to needed Option type.
Sets the author_signature value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn forward<T: Into<Forward>>(self, value: T) -> Self
pub fn forward<T: Into<Forward>>(self, value: T) -> Self
Sets the forward value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn reply_to_message<T: Into<Box<Message>>>(self, value: T) -> Self
pub fn reply_to_message<T: Into<Box<Message>>>(self, value: T) -> Self
Sets the reply_to_message value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn edit_date<T: Into<DateTime<Utc>>>(self, value: T) -> Self
pub fn edit_date<T: Into<DateTime<Utc>>>(self, value: T) -> Self
Sets the edit_date value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn reply_markup<T: Into<InlineKeyboardMarkup>>(self, value: T) -> Self
pub fn reply_markup<T: Into<InlineKeyboardMarkup>>(self, value: T) -> Self
Sets the reply_markup value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn is_topic_message(self, value: bool) -> Self
pub fn is_topic_message(self, value: bool) -> Self
Sets the is_topic_message value of the MockMessageAudio to value.
sourcepub fn is_automatic_forward(self, value: bool) -> Self
pub fn is_automatic_forward(self, value: bool) -> Self
Sets the is_automatic_forward value of the MockMessageAudio to value.
sourcepub fn has_protected_content(self, value: bool) -> Self
pub fn has_protected_content(self, value: bool) -> Self
Sets the has_protected_content value of the MockMessageAudio to value.
sourcepub fn caption<T: Into<String>>(self, value: T) -> Self
pub fn caption<T: Into<String>>(self, value: T) -> Self
Sets the caption value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn caption_entities(self, value: Vec<MessageEntity>) -> Self
pub fn caption_entities(self, value: Vec<MessageEntity>) -> Self
Sets the caption_entities value of the MockMessageAudio to value.
sourcepub fn media_group_id<T: Into<String>>(self, value: T) -> Self
pub fn media_group_id<T: Into<String>>(self, value: T) -> Self
Sets the media_group_id value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn duration(self, value: u32) -> Self
pub fn duration(self, value: u32) -> Self
Sets the duration value of the MockMessageAudio to value.
sourcepub fn performer<T: Into<String>>(self, value: T) -> Self
pub fn performer<T: Into<String>>(self, value: T) -> Self
Sets the performer value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn title<T: Into<String>>(self, value: T) -> Self
pub fn title<T: Into<String>>(self, value: T) -> Self
Sets the title value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn thumb<T: Into<PhotoSize>>(self, value: T) -> Self
pub fn thumb<T: Into<PhotoSize>>(self, value: T) -> Self
Sets the thumb value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn file_name<T: Into<String>>(self, value: T) -> Self
pub fn file_name<T: Into<String>>(self, value: T) -> Self
Sets the file_name value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn mime_type<T: Into<Mime>>(self, value: T) -> Self
pub fn mime_type<T: Into<Mime>>(self, value: T) -> Self
Sets the mime_type value of the MockMessageAudio to value, converting it to needed Option type.
sourcepub fn file_id<T: Into<String>>(self, value: T) -> Self
pub fn file_id<T: Into<String>>(self, value: T) -> Self
Sets the file_id value of the MockMessageAudio to value, converting it to String.
§Example
use teloxide_tests::MockMessageAudio;
let builder = MockMessageAudio::new().file_id("test");
assert_eq!(builder.file_id, "test".to_string());sourcepub fn file_unique_id<T: Into<String>>(self, value: T) -> Self
pub fn file_unique_id<T: Into<String>>(self, value: T) -> Self
Sets the file_unique_id value of the MockMessageAudio to value, converting it to String.
§Example
use teloxide_tests::MockMessageAudio;
let builder = MockMessageAudio::new().file_unique_id("test");
assert_eq!(builder.file_unique_id, "test".to_string());source§impl MockMessageAudio
impl MockMessageAudio
pub const IS_TOPIC_MESSAGE: bool = false
pub const IS_AUTOMATIC_FORWARD: bool = false
pub const HAS_PROTECTED_CONTENT: bool = false
source§impl MockMessageAudio
impl MockMessageAudio
pub const DURATION: u32 = 236u32
pub const FILE_ID: &'static str = "CQADAgADbQEAAsnrIUpNoRRNsH7_hAI"
pub const UNIQUE_FILE_ID: &'static str = "file_unique_id"
pub const FILE_SIZE: u32 = 9_507_774u32
Trait Implementations§
source§impl Clone for MockMessageAudio
impl Clone for MockMessageAudio
source§fn clone(&self) -> MockMessageAudio
fn clone(&self) -> MockMessageAudio
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl IntoUpdate for MockMessageAudio
impl IntoUpdate for MockMessageAudio
source§fn into_update(self, id: AtomicI32) -> Vec<Update>
fn into_update(self, id: AtomicI32) -> Vec<Update>
Converts the MockCallbackQuery into an updates vector
§Example
use teloxide_tests::IntoUpdate;
let mock_message = teloxide_tests::MockMessageText::new();
let update = mock_message.clone().into_update(1.into())[0].clone();
assert_eq!(update.id, 1);
assert_eq!(update.kind, teloxide::types::UpdateKind::Message(
mock_message.build())
);Auto Trait Implementations§
impl Freeze for MockMessageAudio
impl RefUnwindSafe for MockMessageAudio
impl Send for MockMessageAudio
impl Sync for MockMessageAudio
impl Unpin for MockMessageAudio
impl UnwindSafe for MockMessageAudio
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> Erasable for T
impl<T> Erasable for T
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>
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>
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