pub struct Audio {
pub source: String,
pub format: AudioFormat,
pub x: u32,
pub y: u32,
pub width: u32,
pub height: u32,
pub options: AudioOptions,
pub alt_text: Option<String>,
}Expand description
Audio element
Fields§
§source: StringAudio file path or URL
format: AudioFormatAudio format
x: u32Position X in EMU (for icon)
y: u32Position Y in EMU (for icon)
width: u32Icon width in EMU
height: u32Icon height in EMU
options: AudioOptionsPlayback options
alt_text: Option<String>Alt text
Implementations§
Source§impl Audio
impl Audio
Sourcepub fn new(
source: &str,
format: AudioFormat,
x: u32,
y: u32,
width: u32,
height: u32,
) -> Self
pub fn new( source: &str, format: AudioFormat, x: u32, y: u32, width: u32, height: u32, ) -> Self
Create a new audio element
Sourcepub fn from_file(
path: &str,
x: u32,
y: u32,
width: u32,
height: u32,
) -> Option<Self>
pub fn from_file( path: &str, x: u32, y: u32, width: u32, height: u32, ) -> Option<Self>
Create from file path (auto-detect format)
Sourcepub fn with_options(self, options: AudioOptions) -> Self
pub fn with_options(self, options: AudioOptions) -> Self
Set playback options
Sourcepub fn with_alt_text(self, alt: &str) -> Self
pub fn with_alt_text(self, alt: &str) -> Self
Set alt text
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Audio
impl RefUnwindSafe for Audio
impl Send for Audio
impl Sync for Audio
impl Unpin for Audio
impl UnsafeUnpin for Audio
impl UnwindSafe for Audio
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