pub struct EmbedAsset {
pub id: String,
pub path: String,
pub hash: DocumentId,
pub size: u64,
pub mime_type: String,
pub filename: Option<String>,
pub description: Option<String>,
pub inline: bool,
}Expand description
An embedded file asset.
Fields§
§id: StringUnique identifier for the embed.
path: StringPath within the archive (e.g., “assets/embeds/data.csv”).
hash: DocumentIdContent hash for verification.
size: u64File size in bytes.
mime_type: StringMIME type of the embedded file.
filename: Option<String>Original filename (if known).
description: Option<String>Description of the embedded file.
inline: boolWhether the embed should be displayed inline.
Implementations§
Source§impl EmbedAsset
impl EmbedAsset
Sourcepub fn new(id: impl Into<String>, mime_type: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, mime_type: impl Into<String>) -> Self
Create a new embed asset.
Sourcepub fn with_hash(self, hash: DocumentId) -> Self
pub fn with_hash(self, hash: DocumentId) -> Self
Set the content hash.
Sourcepub fn with_filename(self, filename: impl Into<String>) -> Self
pub fn with_filename(self, filename: impl Into<String>) -> Self
Set the original filename.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description.
Sourcepub const fn with_inline(self, inline: bool) -> Self
pub const fn with_inline(self, inline: bool) -> Self
Set whether the embed should be displayed inline.
Trait Implementations§
Source§impl Asset for EmbedAsset
impl Asset for EmbedAsset
Source§fn hash(&self) -> &DocumentId
fn hash(&self) -> &DocumentId
Get the content hash of the asset.
Source§impl Clone for EmbedAsset
impl Clone for EmbedAsset
Source§fn clone(&self) -> EmbedAsset
fn clone(&self) -> EmbedAsset
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmbedAsset
impl Debug for EmbedAsset
Source§impl<'de> Deserialize<'de> for EmbedAsset
impl<'de> Deserialize<'de> for EmbedAsset
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EmbedAsset
impl PartialEq for EmbedAsset
Source§impl Serialize for EmbedAsset
impl Serialize for EmbedAsset
impl Eq for EmbedAsset
impl StructuralPartialEq for EmbedAsset
Auto Trait Implementations§
impl Freeze for EmbedAsset
impl RefUnwindSafe for EmbedAsset
impl Send for EmbedAsset
impl Sync for EmbedAsset
impl Unpin for EmbedAsset
impl UnsafeUnpin for EmbedAsset
impl UnwindSafe for EmbedAsset
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,
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.