Skip to content

zaun_client::Picture · Enum

pub enum Picture { … }

Where an embed’s picture (or a message’s file) comes from. Pictures are never remote URLs: a file is uploaded as one of the message’s attachments, so no reader’s client ever fetches anything from a third party.

A local file, uploaded under its own name.

Bytes, uploaded under name (whose extension gives the media type).

An attachment this member uploaded (and has not posted yet) or, for an edit, one the message already has.

pub fn file<impl Into<PathBuf>>(path: impl Into<PathBuf>) -> Self

The file at path.

pub fn bytes<impl Into<String>, impl Into<Vec<u8>>>(name: impl Into<String>, data: impl Into<Vec<u8>>) -> Self

data, uploaded as a file named name.

pub const fn attachment(id: AttachmentId) -> Self

The attachment id.

Clone, Debug, Eq, From<&Attachment>, From<&Path>, From<AttachmentId>, From<PathBuf>, PartialEq, StructuralPartialEq

Full rustdoc page