pub struct Attachment {
pub data: AttachmentData,
pub id: Option<String>,
pub description: Option<String>,
pub filename: Option<String>,
pub media_type: Option<String>,
pub format: Option<String>,
pub lastmod_time: Option<u64>,
pub byte_count: Option<u64>,
}Expand description
Attachment for a TAP message.
Fields§
§data: AttachmentDataA JSON object that gives access to the actual content of the attachment. Can be based on base64, json or external links.
id: Option<String>Identifies attached content within the scope of a given message. Recommended on appended attachment descriptors. Possible but generally unused on embedded attachment descriptors. Never required if no references to the attachment exist; if omitted, then there is no way to refer to the attachment later in the thread, in error messages, and so forth. Because id is used to compose URIs, it is recommended that this name be brief and avoid spaces and other characters that require URI escaping.
description: Option<String>A human-readable description of the content.
filename: Option<String>A hint about the name that might be used if this attachment is persisted as a file. It is not required, and need not be unique. If this field is present and mime-type is not, the extension on the filename may be used to infer a MIME type.
media_type: Option<String>Describes the MIME type of the attached content.
format: Option<String>Describes the format of the attachment if the mime_type is not sufficient.
lastmod_time: Option<u64>A hint about when the content in this attachment was last modified in UTC Epoch Seconds (seconds since 1970-01-01T00:00:00Z UTC).
byte_count: Option<u64>Mostly relevant when content is included by reference instead of by value. Lets the receiver guess how expensive it will be, in time, bandwidth, and storage, to fully fetch the attachment.
Implementations§
Source§impl Attachment
impl Attachment
pub fn base64(base64: String) -> AttachmentBuilder
pub fn json(json: Value) -> AttachmentBuilder
pub fn links(links: Vec<String>, hash: String) -> AttachmentBuilder
Trait Implementations§
Source§impl Clone for Attachment
impl Clone for Attachment
Source§fn clone(&self) -> Attachment
fn clone(&self) -> Attachment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more