pub struct Media { /* private fields */ }
Expand description
Media attachment for a note
Implementations§
Source§impl Media
impl Media
Sourcepub fn new(source: MediaSource, filename: String, media_type: MediaType) -> Self
pub fn new(source: MediaSource, filename: String, media_type: MediaType) -> Self
Creates a new media with the given source, filename, and type
Sourcepub fn audio(source: MediaSource, filename: String) -> Self
pub fn audio(source: MediaSource, filename: String) -> Self
Creates a new audio media
Sourcepub fn image(source: MediaSource, filename: String) -> Self
pub fn image(source: MediaSource, filename: String) -> Self
Creates a new image media
Sourcepub fn video(source: MediaSource, filename: String) -> Self
pub fn video(source: MediaSource, filename: String) -> Self
Creates a new video media
Sourcepub fn source(&self) -> &MediaSource
pub fn source(&self) -> &MediaSource
Gets the source of this media
Sourcepub fn media_type(&self) -> MediaType
pub fn media_type(&self) -> MediaType
Gets the type of this media
Trait Implementations§
impl Eq for Media
impl StructuralPartialEq for Media
Auto Trait Implementations§
impl Freeze for Media
impl RefUnwindSafe for Media
impl Send for Media
impl Sync for Media
impl Unpin for Media
impl UnwindSafe for Media
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