#[non_exhaustive]pub struct File {
pub id: Option<i32>,
pub file: Box<UnfurledMediaItem>,
pub spoiler: bool,
pub name: Option<CompactString>,
pub size: Option<u64>,
}Expand description
A file: an attached file shown in the message.
discord.js counterpart: FileComponent / FileBuilder.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: Option<i32>The component’s numeric identifier (generated by Discord when not set).
file: Box<UnfurledMediaItem>The file: only attachment://<filename> references are supported.
spoiler: boolWhether the file is blurred until clicked.
name: Option<CompactString>The file’s name (set by Discord in responses; ignored when sending).
size: Option<u64>The file’s size in bytes (set by Discord in responses; ignored when sending).
Implementations§
Trait Implementations§
impl Eq for File
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Forget for File
impl Freeze for File
impl Move for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
impl UnwindSafe for File
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