pub struct Attachment {
pub id: String,
pub format: String,
pub bytes: u64,
pub hash: String,
pub source: Option<String>,
pub data: Option<Arc<[u8]>>,
pub inline_data: bool,
}Expand description
一个附件。id 是内容寻址的文件名:SHA-256 的前 32 位十六进制加扩展名(与 PDF、Office 的
导出文件名同一规则),同一内容只有一个 id。
Fields§
§id: String§format: String格式(文件扩展名):jpg、png、gif、webp、svg、jp2、tif、jb2……
bytes: u64字节数。
hash: String内容的 SHA-256(小写十六进制)。
source: Option<String>来源:网页图片的原地址、Office 文档里的部件路径(与 Markdown 里的引用一致);PDF 图片为空
(Markdown 里直接引用 images/<id>)。
data: Option<Arc<[u8]>>文件内容。
inline_data: boolInclude Base64 data in human-readable output for the opt-in asset API.
Implementations§
Source§impl Attachment
impl Attachment
Trait Implementations§
Source§impl Clone for Attachment
impl Clone for Attachment
Source§impl Debug for Attachment
impl Debug for Attachment
Source§impl Default for Attachment
impl Default for Attachment
Source§impl<'de> Deserialize<'de> for Attachment
impl<'de> Deserialize<'de> for Attachment
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Attachment
Source§impl PartialEq for Attachment
impl PartialEq for Attachment
Source§impl Serialize for Attachment
impl Serialize for Attachment
impl StructuralPartialEq for Attachment
Auto Trait Implementations§
impl Forget for Attachment
impl Freeze for Attachment
impl RefUnwindSafe for Attachment
impl Send for Attachment
impl Sync for Attachment
impl Unpin for Attachment
impl UnsafeUnpin for Attachment
impl UnwindSafe for Attachment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.