EventContext

Struct EventContext 

Source
pub struct EventContext<'parent> { /* private fields */ }
Expand description

Context to listen to events.

Implementations§

Source§

impl<'parent> EventContext<'parent>

Source

pub fn enable_event(&self, ev: EventId) -> Result<()>

Enable an event.

Source

pub fn enable_all_events(&self) -> Result<()>

Enable all, except deprecated, events.

Source

pub fn disable_event(&self, ev: EventId) -> Result<()>

Disable an event.

Source

pub fn disable_deprecated_events(&self) -> Result<()>

Diable all deprecated events.

Source

pub fn disable_all_events(&self) -> Result<()>

Diable all events.

Source

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.

Source

pub fn unobserve_property(&self, id: u64) -> Result<()>

Unobserve any property associated with id.

Source

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§

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.