pub struct MediaMetadata {Show 16 fields
pub mime_type: String,
pub file_name: String,
pub file_size: u64,
pub duration_ms: Option<u64>,
pub width: Option<u32>,
pub height: Option<u32>,
pub thumbnail_base64: Option<String>,
pub media_id: Option<String>,
pub download_url: Option<String>,
pub thumbnail_url: Option<String>,
pub encryption_key: Option<String>,
pub iv: Option<String>,
pub ciphertext_hash: Option<String>,
pub sticker_provider: Option<String>,
pub sticker_remote_id: Option<String>,
pub sticker_kind: Option<String>,
}Expand description
Metadata describing a media attachment.
Fields§
§mime_type: StringMIME type (e.g. “image/jpeg”, “video/mp4”).
file_name: StringOriginal file name.
file_size: u64File size in bytes.
duration_ms: Option<u64>Duration in milliseconds (audio/video/voice-note/video-note).
width: Option<u32>Width in pixels (images and video).
height: Option<u32>Height in pixels (images and video).
thumbnail_base64: Option<String>Small base64-encoded thumbnail (< 2 KB) for preview.
media_id: Option<String>Stable media identifier assigned by the application.
download_url: Option<String>URL to fetch the full media from (cloud-stored media).
thumbnail_url: Option<String>URL to fetch a thumbnail from (cloud-stored media).
encryption_key: Option<String>Content-encryption key for cloud-stored media (base64).
Secret material: must only travel inside an end-to-end-encrypted
payload, never in cleartext message fields visible to relays.
Enforced at the transport wire chokepoint, which strips it (via
MediaMetadata::without_secrets) from every outbound cleartext
frame, and by the telemetry scrubber, which redacts it
unconditionally before events reach a sink.
iv: Option<String>Initialization vector for the cloud-media content encryption (base64).
Secret material — same handling as Self::encryption_key.
ciphertext_hash: Option<String>Integrity hash of the encrypted cloud-media blob (base64).
sticker_provider: Option<String>Sticker pack provider (sticker messages).
sticker_remote_id: Option<String>Provider-scoped sticker identifier (sticker messages).
sticker_kind: Option<String>Sticker rendering kind (e.g. “static”, “animated”, “lottie”).
Implementations§
Source§impl MediaMetadata
impl MediaMetadata
Sourcepub fn has_secrets(&self) -> bool
pub fn has_secrets(&self) -> bool
True when any confidential field (Self::encryption_key,
Self::iv) is set.
Sourcepub fn without_secrets(&self) -> Self
pub fn without_secrets(&self) -> Self
Returns a copy with the confidential fields cleared.
The cloud-media content key (and its IV) grant access to the media itself, so they must only ever travel inside an end-to-end-encrypted payload. Every path that writes metadata into a cleartext surface — the transport wire encoders, the telemetry event scrubber — routes through this before emitting. The remaining fields (URLs, hashes, sticker identity, dimensions) are display hints, not secrets, and are preserved.
Trait Implementations§
Source§impl Clone for MediaMetadata
impl Clone for MediaMetadata
Source§fn clone(&self) -> MediaMetadata
fn clone(&self) -> MediaMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more