pub enum ChatAttachment {
Image {
data: String,
mime_type: String,
},
}Expand description
Attachments to a Request::Chat message.
Today only images are supported; the structure is an open enum so we can add more attachment kinds without bumping the protocol shape.
Variants§
Image
An image. data is base64-encoded image bytes; mime_type is one
of the MIME types accepted by the validator (image/png, image/jpeg,
image/gif, image/webp). The server validates both fields before
building the UserMessage and rejects oversized or malformed payloads
with a Response::Error rather than panicking.
Implementations§
Source§impl ChatAttachment
impl ChatAttachment
Sourcepub fn to_user_content(&self) -> UserContent
pub fn to_user_content(&self) -> UserContent
Convert this attachment into an engine UserContent block.
Pure structural mapping; callers that need validation (decoded byte length, allowed MIME, etc.) should run that before calling this.
Trait Implementations§
Source§impl Clone for ChatAttachment
impl Clone for ChatAttachment
Source§fn clone(&self) -> ChatAttachment
fn clone(&self) -> ChatAttachment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChatAttachment
impl Debug for ChatAttachment
Source§impl<'de> Deserialize<'de> for ChatAttachment
impl<'de> Deserialize<'de> for ChatAttachment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ChatAttachment
impl PartialEq for ChatAttachment
Source§impl Serialize for ChatAttachment
impl Serialize for ChatAttachment
impl Eq for ChatAttachment
impl StructuralPartialEq for ChatAttachment
Auto Trait Implementations§
impl Freeze for ChatAttachment
impl RefUnwindSafe for ChatAttachment
impl Send for ChatAttachment
impl Sync for ChatAttachment
impl Unpin for ChatAttachment
impl UnsafeUnpin for ChatAttachment
impl UnwindSafe for ChatAttachment
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