pub struct MpvIpc { /* private fields */ }
Implementations§
Source§impl MpvIpc
impl MpvIpc
Sourcepub async fn spawn(opt: &MpvSpawnOptions) -> Result<Self>
pub async fn spawn(opt: &MpvSpawnOptions) -> Result<Self>
Spawn a new mpv process and attach to it.
pub async fn running(&self) -> bool
Sourcepub async fn send_command(&mut self, cmd: Value) -> Result<Value>
pub async fn send_command(&mut self, cmd: Value) -> Result<Value>
Send a command to mpv and wait for a reply.
This should not be used to quit
because it will never receive a reply. Use the quit
function instead.
Sourcepub async fn disconnect(&mut self)
pub async fn disconnect(&mut self)
Disconnect from the IPC socket.
pub async fn get_prop<T: DeserializeOwned>(&mut self, name: &str) -> Result<T>
pub async fn set_prop( &mut self, name: &str, value: impl Serialize, ) -> Result<()>
pub async fn watch_event<A, F, Fut>( &mut self, name: impl AsRef<str> + 'static + Send + Sync + Serialize + Display, callback: F, )
pub async fn observe_prop<T: 'static + Send + Sync + Clone + DeserializeOwned>( &mut self, name: impl AsRef<str> + 'static + Send + Sync + Serialize + Display, default: T, ) -> Receiver<T>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MpvIpc
impl !RefUnwindSafe for MpvIpc
impl Send for MpvIpc
impl Sync for MpvIpc
impl Unpin for MpvIpc
impl !UnwindSafe for MpvIpc
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