MpvLink

Struct MpvLink 

Source
pub struct MpvLink { /* private fields */ }

Implementations§

Source

pub fn spawn_client() -> Result<Self, MpvLinkInitError>

Spawns a new child process and uses the input-ipc-client option to pass it a socket.

Source

pub fn spawn_server(path: &Path) -> Result<Self, MpvLinkInitError>

Spawns a new child process and uses the input-ipc-server option to pass it a path where to create a socket.

Source

pub fn connect(path: &Path) -> Result<Self, MpvLinkInitError>

Connects to an existing process spawned with input-ipc-server option by opening the socket.

Source

pub fn set_nonblocking(&mut self, nonblocking: bool) -> Result<(), Error>

Source

pub fn wait_read(&self, timeout: Option<Duration>) -> Result<(), Error>

Blocks until reading becomes available on self.stream().

If timeout is not None then returns Err(TimedOut) on timeout.

Source

pub fn stream(&mut self) -> impl Read + Write + '_

Returns the RW stream for this link.

§Panic

Panics is self has been deinitialized.

Source

pub fn is_deinit(&self) -> bool

Returns true if self.deinit() has been called.

Source

pub fn deinit(&mut self) -> Result<(), MpvLinkDeinitError>

Deinitializes self.

If self has been deinitialized returns Ok(()).

Trait Implementations§

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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.