Struct Attachment
zaun_client::Attachment · Struct
pub struct Attachment { … }A file on a message.
Methods
Section titled “Methods”pub const fn id(&self) -> AttachmentIdIts id.
pub fn name(&self) -> &strIts name (empty when the cache does not have it).
pub const fn size(&self) -> u64Its size in bytes.
content_type
Section titled “content_type”pub fn content_type(&self) -> &strIts media type.
pub const fn data(&self) -> &AttachmentDataThe attachment as the protocol describes it.
message
Section titled “message”pub const fn message(&self) -> &MessageThe message it is on.
download
Section titled “download”pub fn download<impl AsRef<Path>>(&self, dest: impl AsRef<Path>) -> Result<PathBuf>Downloads the file into the folder dest under a safe name and answers its path,
once its size and SHA3-256 match.
Errors
Section titled “Errors”The host refused, the transfer failed or timed out, or the file does not match.
Trait implementations
Section titled “Trait implementations”Clone, Debug, From<&Attachment>