logo
pub enum SwapchainCreationError {
Show 19 variants OomError(OomError), DeviceLost, SurfaceLost, SurfaceInUse, NativeWindowInUse, RequirementNotMet { required_for: &'static str, requires_one_of: RequiresOneOf, }, CompositeAlphaNotSupported { provided: CompositeAlpha, supported: SupportedCompositeAlpha, }, FormatColorSpaceNotSupported, ImageArrayLayersNotSupported { provided: u32, max_supported: u32, }, ImageExtentNotSupported { provided: [u32; 2], min_supported: [u32; 2], max_supported: [u32; 2], }, ImageExtentZeroLengthDimensions, ImageFormatPropertiesNotSupported, ImageSharingQueueFamilyIndexOutOfRange { queue_family_index: u32, queue_family_count: u32, }, ImageUsageNotSupported { provided: ImageUsage, supported: ImageUsage, }, MinImageCountNotSupported { provided: u32, min_supported: u32, max_supported: Option<u32>, }, PresentModeNotSupported, PreTransformNotSupported { provided: SurfaceTransform, supported: SupportedSurfaceTransforms, }, SwapchainAlreadyRetired, Win32MonitorInvalid,
}
Expand description

Error that can happen when creating a Swapchain.

Variants

OomError(OomError)

Not enough memory.

DeviceLost

The device was lost.

SurfaceLost

The surface was lost.

SurfaceInUse

The surface is already used by another swapchain.

NativeWindowInUse

The window is already in use by another API.

RequirementNotMet

Fields

required_for: &'static str
requires_one_of: RequiresOneOf

CompositeAlphaNotSupported

Fields

provided: CompositeAlpha

The provided composite_alpha is not supported by the surface for this device.

FormatColorSpaceNotSupported

The provided format and color_space are not supported by the surface for this device.

ImageArrayLayersNotSupported

Fields

provided: u32
max_supported: u32

The provided image_array_layers is greater than what is supported by the surface for this device.

ImageExtentNotSupported

Fields

provided: [u32; 2]
min_supported: [u32; 2]
max_supported: [u32; 2]

The provided image_extent is not within the range supported by the surface for this device.

ImageExtentZeroLengthDimensions

The provided image_extent contained at least one dimension of zero length. This is prohibited by VUID-VkSwapchainCreateInfoKHR-imageExtent-01689 which requires both the width and height be non-zero.

This error is distinct from ImageExtentNotSupported because a surface’s minimum supported length may not enforce this rule.

ImageFormatPropertiesNotSupported

The provided image parameters are not supported as queried from image_format_properties.

ImageSharingQueueFamilyIndexOutOfRange

Fields

queue_family_index: u32
queue_family_count: u32

The provided image_sharing was set to Concurrent, but one of the specified queue family indices was out of range.

ImageUsageNotSupported

Fields

provided: ImageUsage
supported: ImageUsage

The provided image_usage has fields set that are not supported by the surface for this device.

MinImageCountNotSupported

Fields

provided: u32
min_supported: u32
max_supported: Option<u32>

The provided min_image_count is not within the range supported by the surface for this device.

PresentModeNotSupported

The provided present_mode is not supported by the surface for this device.

PreTransformNotSupported

Fields

provided: SurfaceTransform

The provided pre_transform is not supported by the surface for this device.

SwapchainAlreadyRetired

The swapchain has already been used to create a new one.

Win32MonitorInvalid

The win32_monitor value was Some when it must be None or vice-versa.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0:

use the Display impl or to_string()

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.