pub struct EventContext<'parent> { /* private fields */ }Expand description
Context to listen to events.
Implementations§
Source§impl<'parent> EventContext<'parent>
impl<'parent> EventContext<'parent>
Sourcepub fn enable_event(&self, ev: EventId) -> Result<()>
pub fn enable_event(&self, ev: EventId) -> Result<()>
Enable an event.
Sourcepub fn enable_all_events(&self) -> Result<()>
pub fn enable_all_events(&self) -> Result<()>
Enable all, except deprecated, events.
Sourcepub fn disable_event(&self, ev: EventId) -> Result<()>
pub fn disable_event(&self, ev: EventId) -> Result<()>
Disable an event.
Sourcepub fn disable_deprecated_events(&self) -> Result<()>
pub fn disable_deprecated_events(&self) -> Result<()>
Diable all deprecated events.
Sourcepub fn disable_all_events(&self) -> Result<()>
pub fn disable_all_events(&self) -> Result<()>
Diable all events.
Sourcepub fn observe_property(
&self,
name: &str,
format: Format,
id: u64,
) -> Result<()>
pub fn observe_property( &self, name: &str, format: Format, id: u64, ) -> Result<()>
Observe name property for changes. id can be used to unobserve this (or many) properties
again.
Sourcepub fn unobserve_property(&self, id: u64) -> Result<()>
pub fn unobserve_property(&self, id: u64) -> Result<()>
Unobserve any property associated with id.
Sourcepub fn wait_event(&mut self, timeout: f64) -> Option<Result<Event<'_>>>
pub fn wait_event(&mut self, timeout: f64) -> Option<Result<Event<'_>>>
Wait for timeout seconds for an Event. Passing 0 as timeout will poll.
For more information, as always, see the mpv-sys docs of mpv_wait_event.
This function is intended to be called repeatedly in a wait-event loop.
Returns Some(Err(...)) if there was invalid utf-8, or if either an
MPV_EVENT_GET_PROPERTY_REPLY, MPV_EVENT_SET_PROPERTY_REPLY, MPV_EVENT_COMMAND_REPLY,
or MPV_EVENT_PROPERTY_CHANGE event failed, or if MPV_EVENT_END_FILE reported an error.
Trait Implementations§
impl<'parent> Send for EventContext<'parent>
Auto Trait Implementations§
impl<'parent> Freeze for EventContext<'parent>
impl<'parent> RefUnwindSafe for EventContext<'parent>
impl<'parent> !Sync for EventContext<'parent>
impl<'parent> Unpin for EventContext<'parent>
impl<'parent> UnwindSafe for EventContext<'parent>
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