Struct openxr::Entry

source ·
pub struct Entry { /* private fields */ }
Expand description

Entry point to the API. Start here.

An Entry represents access to an OpenXR implementation. When the crate is built with the linked feature, this can be obtained at compile time with the linked constructor. The static feature provides a built-in copy of the Khronos OpenXR loader for use in this pattern. Alternatively, the loaded feature exposes the load and load_from constructors to manually load an OpenXR implementation at run-time.

Implementations§

source§

impl Entry

source

pub fn linked() -> Self

Access entry points linked directly into the binary at compile time

Available if the linked feature is enabled. You must ensure that the entry points are actually linked into the binary, e.g. by enabling the static feature or manually linking to an external loader or implementation.

source

pub unsafe fn load() -> Result<Self, LoadError>

Load entry points at run time from the dynamic library openxr_loader according to the target platform’s naming conventions

Available if the loaded feature is enabled.

§Safety

The OpenXR loader shared library in the dynamic loader’s search path must conform to the OpenXR specification.

source

pub unsafe fn load_from(path: &Path) -> Result<Self, LoadError>

Load entry points at run time from the dynamic library identified by path

Available if the loaded feature is enabled.

§Safety

path must be a shared library that provides OpenXR-compliant definitions for every core OpenXR entry point.

source

pub unsafe fn from_get_instance_proc_addr( get_instance_proc_addr: GetInstanceProcAddr ) -> Result<Self>

Load entry points using an arbitrary xrGetInstanceProcAddr implementation

§Safety

For all core OpenXR instance functions, get_instance_proc_addr must yield function pointers that satisfy the semantics given in the OpenXR specification.

source

pub fn fp(&self) -> &RawEntry

Access the raw function pointers

source

pub fn create_instance( &self, app_info: &ApplicationInfo<'_>, required_extensions: &ExtensionSet, layers: &[&str] ) -> Result<Instance>

Create an OpenXR instance with certain extensions enabled. Android support can be enabled by setting khr_android_create_instance to true.

Most applications will want to enable at least one graphics API extension (e.g. khr_vulkan_enable2) so that a Session can be created for rendering.

source

pub fn enumerate_extensions(&self) -> Result<ExtensionSet>

Determine the set of extensions supported by this OpenXR implementation

source

pub fn enumerate_layers(&self) -> Result<Vec<ApiLayerProperties>>

Trait Implementations§

source§

impl Clone for Entry

source§

fn clone(&self) -> Entry

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

Auto Trait Implementations§

§

impl RefUnwindSafe for Entry

§

impl Send for Entry

§

impl Sync for Entry

§

impl Unpin for Entry

§

impl UnwindSafe for Entry

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.