#[non_exhaustive]pub struct MessageCreateInput<'a> {
pub client_id: Option<&'a str>,
pub chat_id: &'a Id,
pub body: &'a str,
pub body_type: BodyType,
pub sent_at: &'a UTCDate,
pub reply_to: Option<&'a Id>,
}Expand description
Input parameters for Message/set create.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.client_id: Option<&'a str>Caller-supplied creation key. When None, a ULID is generated automatically.
chat_id: &'a IdThe Chat this message belongs to.
body: &'a strMessage body text (interpreted per body_type).
body_type: BodyTypeMIME type for the message body.
sent_at: &'a UTCDateRFC 3339 timestamp.
reply_to: Option<&'a Id>When Some, marks this message as a reply to the given message id.
Implementations§
Source§impl<'a> MessageCreateInput<'a>
impl<'a> MessageCreateInput<'a>
Sourcepub fn new(
chat_id: &'a Id,
body: &'a str,
body_type: BodyType,
sent_at: &'a UTCDate,
) -> Self
pub fn new( chat_id: &'a Id, body: &'a str, body_type: BodyType, sent_at: &'a UTCDate, ) -> Self
Create a MessageCreateInput with required fields; optional fields default to None.
Sourcepub fn with_client_id(self, id: &'a str) -> Self
pub fn with_client_id(self, id: &'a str) -> Self
Set the caller-supplied creation key (overrides the auto-generated ULID).
Sourcepub fn with_reply_to(self, id: &'a Id) -> Self
pub fn with_reply_to(self, id: &'a Id) -> Self
Set the message this one replies to.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for MessageCreateInput<'a>
impl<'a> RefUnwindSafe for MessageCreateInput<'a>
impl<'a> Send for MessageCreateInput<'a>
impl<'a> Sync for MessageCreateInput<'a>
impl<'a> Unpin for MessageCreateInput<'a>
impl<'a> UnsafeUnpin for MessageCreateInput<'a>
impl<'a> UnwindSafe for MessageCreateInput<'a>
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
Mutably borrows from an owned value. Read more