Skip to main content

PrismPluginBackend

Struct PrismPluginBackend 

Source
#[repr(C)]
pub struct PrismPluginBackend { pub abi_version: u64, pub struct_size: u32, pub reserved: u32, pub name: *const c_char, pub priority: c_int, pub features: u64, pub vtable: *const PrismBackendVTable, pub userdata: *mut c_void, pub plugin_version: u64, }
Expand description

A descriptor supplied by a plugin to describe a single backend.

Fields§

§abi_version: u64

The plugin ABI generation this descriptor was built against. A plugin MUST set this member to the PRISM_PLUGIN_ABI_VERSION against which it was compiled. Prism rejects a descriptor whose generation it does not accept, as described under ABI compatibility.

§struct_size: u32

The size of this structure as the plugin understands it. A plugin MUST set this member to sizeof(PrismPluginBackend). Prism consults at most this many bytes.

§reserved: u32

Reserved for future use. A plugin MUST set this member to zero.

§name: *const c_char

The backend’s name, as a null-terminated UTF-8 string, subject to the same requirements and consequences as the name parameter of prism_registry_builder_add_backend. The backend’s identifier is derived from it by the hash function described in the chapter on backend identifiers. The string is copied during loading.

§priority: c_int

The backend’s priority. Higher values indicate higher priority. This value MUST be non-negative unless the loading call supplies a priority override, in which case it is ignored.

§features: u64

The feature set the backend declares, formed by ORing PRISM_BACKEND_* feature constants together. It MUST be consistent with the vtable in the sense required of any custom backend.

§vtable: *const PrismBackendVTable

The vtable implementing the backend, subject to every requirement placed on a vtable by the chapter on custom backends. This member MUST NOT be NULL, and its size member MUST be set as that chapter requires. The vtable MUST provide a create member, as described under Host services. The vtable is copied during loading; the code it names remains valid while the library remains loaded.

§userdata: *mut c_void

An opaque pointer that Prism delivers to the backend’s create member as the userdata member of a PrismPluginInstanceContext (see PrismPluginInstanceContext). It has the meaning the userdata parameter of prism_registry_builder_add_backend would have, and permits several descriptors that share one vtable to be distinguished at instance creation. This member MAY be NULL. Prism does not free it.

§plugin_version: u64

An informational version identifying the plugin’s own release, distinct from the ABI generation and used for no compatibility decision. The value is three 16-bit components, major, minor, and patch, packed most-significant first, with the least-significant 16 bits reserved and set to zero. A plugin MAY set it to zero if it has no version to report.

Trait Implementations§

Source§

impl Debug for PrismPluginBackend

Source§

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

Formats the value using the given formatter. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.