pub struct Protocol<T: Sized + RefUnwindSafe, U: RefUnwindSafe> { /* private fields */ }
Expand description
Protocol
holds all state used by a custom protocol.
Implementations§
source§impl<T: RefUnwindSafe, U: RefUnwindSafe> Protocol<T, U>
impl<T: RefUnwindSafe, U: RefUnwindSafe> Protocol<T, U>
sourcepub unsafe fn new(
name: String,
user_data: U,
open_fn: StreamOpen<T, U>,
close_fn: StreamClose<T>,
read_fn: StreamRead<T>,
seek_fn: Option<StreamSeek<T>>,
size_fn: Option<StreamSize<T>>
) -> Protocol<T, U>
pub unsafe fn new( name: String, user_data: U, open_fn: StreamOpen<T, U>, close_fn: StreamClose<T>, read_fn: StreamRead<T>, seek_fn: Option<StreamSeek<T>>, size_fn: Option<StreamSize<T>> ) -> Protocol<T, U>
name
is the prefix of the protocol, e.g. name://path
.
user_data
is data that will be passed to open_fn
.
§Safety
Do not call libmpv functions in any supplied function. All panics of the provided functions are catched and can be used as generic error returns.
Auto Trait Implementations§
impl<T, U> Freeze for Protocol<T, U>
impl<T, U> RefUnwindSafe for Protocol<T, U>
impl<T, U> !Send for Protocol<T, U>
impl<T, U> !Sync for Protocol<T, U>
impl<T, U> Unpin for Protocol<T, U>
impl<T, U> UnwindSafe for Protocol<T, U>
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