pub struct InstanceCreateInfo {
    pub flags: InstanceCreateFlags,
    pub application_name: Option<String>,
    pub application_version: Version,
    pub engine_name: Option<String>,
    pub engine_version: Version,
    pub max_api_version: Option<Version>,
    pub enabled_layers: Vec<String>,
    pub enabled_extensions: InstanceExtensions,
    pub debug_utils_messengers: Vec<DebugUtilsMessengerCreateInfo>,
    pub enabled_validation_features: Vec<ValidationFeatureEnable>,
    pub disabled_validation_features: Vec<ValidationFeatureDisable>,
    pub _ne: NonExhaustive,
}
Expand description

Parameters to create a new Instance.

Fields§

§flags: InstanceCreateFlags

Additional properties of the instance.

The default value is empty.

§application_name: Option<String>

A string of your choice stating the name of your application.

The default value is None.

§application_version: Version

A version number of your choice specifying the version of your application.

The default value is zero.

§engine_name: Option<String>

A string of your choice stating the name of the engine used to power the application.

§engine_version: Version

A version number of your choice specifying the version of the engine used to power the application.

The default value is zero.

§max_api_version: Option<Version>

The highest Vulkan API version that the application will use with the instance.

Usually, you will want to leave this at the default.

The default value is Version::HEADER_VERSION, but if the supported instance version is 1.0, then it will be 1.0.

§enabled_layers: Vec<String>

The layers to enable on the instance.

The default value is empty.

§enabled_extensions: InstanceExtensions

The extensions to enable on the instance.

You only need to enable the extensions that you need. If the extensions you specified require additional extensions to be enabled, they will be automatically enabled as well.

The default value is InstanceExtensions::empty().

§debug_utils_messengers: Vec<DebugUtilsMessengerCreateInfo>

Creation parameters for debug messengers, to use during the creation and destruction of the instance.

The debug messengers are not used at any other time, DebugUtilsMessenger should be used for that.

If this is not empty, the ext_debug_utils extension must be set in enabled_extensions.

The default value is empty.

§enabled_validation_features: Vec<ValidationFeatureEnable>

Features of the validation layer to enable.

If not empty, the ext_validation_features extension must be enabled on the instance.

§disabled_validation_features: Vec<ValidationFeatureDisable>

Features of the validation layer to disable.

If not empty, the ext_validation_features extension must be enabled on the instance.

§_ne: NonExhaustive

Implementations§

source§

impl InstanceCreateInfo

source

pub fn application_from_cargo_toml() -> Self

Returns an InstanceCreateInfo with the application_name and application_version set from information in your crate’s Cargo.toml file.

Panics
  • Panics if the required environment variables are missing, which happens if the project wasn’t built by Cargo.

Trait Implementations§

source§

impl Debug for InstanceCreateInfo

source§

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

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

impl Default for InstanceCreateInfo

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.