pub struct Attachment { /* private fields */ }Expand description
A file in an AttachmentStrip.
Implementations§
Source§impl Attachment
impl Attachment
Sourcepub fn new(name: impl Into<String>) -> Attachment
pub fn new(name: impl Into<String>) -> Attachment
A file called name.
Sourcepub fn size(self, bytes: u64) -> Attachment
pub fn size(self, bytes: u64) -> Attachment
Its size in bytes, which is shown in the units people read.
Sourcepub fn icon(self, icon: IconName) -> Attachment
pub fn icon(self, icon: IconName) -> Attachment
The icon before its name (IconName::File by default).
Sourcepub fn thumbnail(self, image: ImageData) -> Attachment
pub fn thumbnail(self, image: ImageData) -> Attachment
A small picture in place of the icon.
Sourcepub fn send_as(
self,
options: impl IntoIterator<Item = impl Into<String>>,
chosen: usize,
on_choose: impl Fn(usize) + 'static,
) -> Attachment
pub fn send_as( self, options: impl IntoIterator<Item = impl Into<String>>, chosen: usize, on_choose: impl Fn(usize) + 'static, ) -> Attachment
The ways this file can be sent, such as a photo or a document, with chosen selected.
on_choose gets the index of another one. With fewer than two there is nothing to
ask, and the row does not ask.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Attachment
impl !Send for Attachment
impl !Sync for Attachment
impl !UnwindSafe for Attachment
impl Freeze for Attachment
impl Unpin for Attachment
impl UnsafeUnpin for Attachment
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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