pub struct Stream(/* private fields */);Expand description
An open stream; dropping it closes it.
Implementations§
Source§impl Stream
impl Stream
Sourcepub fn open(url: &str) -> Option<Stream>
pub fn open(url: &str) -> Option<Stream>
A stream from an https URL, not playing yet. None if refused (refusal says why).
pub fn play(&self)
pub fn pause(&self)
Sourcepub fn set_volume(&self, gain: f32)
pub fn set_volume(&self, gain: f32)
0 to 1, applied smoothly.
Sourcepub fn set_lowpass(&self, hz: f32)
pub fn set_lowpass(&self, hz: f32)
A low-pass filter at hz (0: off), where Caps::lowpass.
pub fn caps(&self) -> Caps
pub fn state(&self) -> State
Sourcepub fn duration(&self) -> Option<f64>
pub fn duration(&self) -> Option<f64>
A track’s length in seconds; None for live streams and while unknown.
Sourcepub fn metadata_version(&self) -> u32
pub fn metadata_version(&self) -> u32
Changes whenever the metadata does: read Stream::metadata only then.
Sourcepub fn metadata_json(&self) -> String
pub fn metadata_json(&self) -> String
The metadata as the runner gives it (JSON).
pub fn metadata(&self) -> Metadata
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stream
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnsafeUnpin for Stream
impl UnwindSafe for Stream
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