pub enum MediaSource {
Url(String),
FilePath(String),
Bytes(Vec<u8>),
}Expand description
The source of a media asset — a URL, local file path, or raw bytes.
Variants§
Url(String)
A remote URL (http/https).
FilePath(String)
A local file path.
Bytes(Vec<u8>)
Raw bytes (e.g. an in-memory image).
Implementations§
Source§impl MediaSource
impl MediaSource
Sourcepub fn display_short(&self) -> String
pub fn display_short(&self) -> String
Returns a short display string for logging, truncating URLs beyond 80 characters.
Trait Implementations§
Source§impl Clone for MediaSource
impl Clone for MediaSource
Source§fn clone(&self) -> MediaSource
fn clone(&self) -> MediaSource
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 MediaSource
impl Debug for MediaSource
Source§impl<'de> Deserialize<'de> for MediaSource
impl<'de> Deserialize<'de> for MediaSource
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 From<&str> for MediaSource
impl From<&str> for MediaSource
Source§impl From<String> for MediaSource
impl From<String> for MediaSource
Auto Trait Implementations§
impl Freeze for MediaSource
impl RefUnwindSafe for MediaSource
impl Send for MediaSource
impl Sync for MediaSource
impl Unpin for MediaSource
impl UnsafeUnpin for MediaSource
impl UnwindSafe for MediaSource
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