#[repr(C)]
pub struct pw_core_methods { pub version: u32, pub add_listener: Option<unsafe extern "C" fn(object: *mut c_void, listener: *mut spa_hook, events: *const pw_core_events, data: *mut c_void) -> c_int>, pub hello: Option<unsafe extern "C" fn(object: *mut c_void, version: u32) -> c_int>, pub sync: Option<unsafe extern "C" fn(object: *mut c_void, id: u32, seq: c_int) -> c_int>, pub pong: Option<unsafe extern "C" fn(object: *mut c_void, id: u32, seq: c_int) -> c_int>, pub error: Option<unsafe extern "C" fn(object: *mut c_void, id: u32, seq: c_int, res: c_int, message: *const c_char) -> c_int>, pub get_registry: Option<unsafe extern "C" fn(object: *mut c_void, version: u32, user_data_size: usize) -> *mut pw_registry>, pub create_object: Option<unsafe extern "C" fn(object: *mut c_void, factory_name: *const c_char, type_: *const c_char, version: u32, props: *const spa_dict, user_data_size: usize) -> *mut c_void>, pub destroy: Option<unsafe extern "C" fn(object: *mut c_void, proxy: *mut c_void) -> c_int>, }
Expand description

\struct pw_core_methods \brief Core methods

The core global object. This is a singleton object used for creating new objects in the remote PipeWire instance. It is also used for internal features.

Fields§

§version: u32§add_listener: Option<unsafe extern "C" fn(object: *mut c_void, listener: *mut spa_hook, events: *const pw_core_events, data: *mut c_void) -> c_int>§hello: Option<unsafe extern "C" fn(object: *mut c_void, version: u32) -> c_int>

Start a conversation with the server. This will send the core info and will destroy all resources for the client (except the core and client resource).

This requires X permissions on the core.

§sync: Option<unsafe extern "C" fn(object: *mut c_void, id: u32, seq: c_int) -> c_int>

Do server roundtrip

Ask the server to emit the ‘done’ event with \a seq.

Since methods are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous methods and the resulting events have been handled.

\param seq the seq number passed to the done event

This requires X permissions on the core.

§pong: Option<unsafe extern "C" fn(object: *mut c_void, id: u32, seq: c_int) -> c_int>

Reply to a server ping event.

Reply to the server ping event with the same seq.

\param seq the seq number received in the ping event

This requires X permissions on the core.

§error: Option<unsafe extern "C" fn(object: *mut c_void, id: u32, seq: c_int, res: c_int, message: *const c_char) -> c_int>

Fatal error event

The error method is sent out when a fatal (non-recoverable) error has occurred. The id argument is the proxy object where the error occurred, most often in response to an event on that object. The message is a brief description of the error, for (debugging) convenience.

This method is usually also emitted on the resource object with \a id.

\param id resource id where the error occurred \param res error code \param message error description

This requires X permissions on the core.

§get_registry: Option<unsafe extern "C" fn(object: *mut c_void, version: u32, user_data_size: usize) -> *mut pw_registry>

Get the registry object

Create a registry object that allows the client to list and bind the global objects available from the PipeWire server \param version the client version \param user_data_size extra size

This requires X permissions on the core.

§create_object: Option<unsafe extern "C" fn(object: *mut c_void, factory_name: *const c_char, type_: *const c_char, version: u32, props: *const spa_dict, user_data_size: usize) -> *mut c_void>

Create a new object on the PipeWire server from a factory.

\param factory_name the factory name to use \param type the interface to bind to \param version the version of the interface \param props extra properties \param user_data_size extra size

This requires X permissions on the core.

§destroy: Option<unsafe extern "C" fn(object: *mut c_void, proxy: *mut c_void) -> c_int>

Destroy an resource

Destroy the server resource for the given proxy.

\param obj the proxy to destroy

This requires X permissions on the core.

Trait Implementations§

source§

impl Clone for pw_core_methods

source§

fn clone(&self) -> pw_core_methods

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for pw_core_methods

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for pw_core_methods

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.