logo
pub struct Surface<W> { /* private fields */ }
Expand description

Represents a surface on the screen.

Creating a Surface is platform-specific.

Implementations

Creates a Surface given the raw handle.

Safety
  • handle must be a valid Vulkan surface handle owned by instance.
  • handle must have been created from api.
  • The window object that handle was created from must outlive the created Surface. The win parameter can be used to ensure this.

Creates a Surface from a DisplayPlane.

Panic
  • Panics if display_mode and plane don’t belong to the same physical device.
  • Panics if plane doesn’t support the display of display_mode.

Creates a Surface from an Android window.

Safety
  • window must be a valid handle.
  • The object referred to by window must outlive the created Surface. The win parameter can be used to ensure this.

Creates a Surface from an iOS UIView.

Safety
  • view must be a valid handle.
  • The object referred to by view must outlive the created Surface. The win parameter can be used to ensure this.
  • The UIView must be backed by a CALayer instance of type CAMetalLayer.

Creates a Surface from a MacOS NSView.

Safety
  • view must be a valid handle.
  • The object referred to by view must outlive the created Surface. The win parameter can be used to ensure this.
  • The NSView must be backed by a CALayer instance of type CAMetalLayer.

Creates a Surface from a Metal CAMetalLayer.

Safety
  • layer must be a valid handle.
  • The object referred to by layer must outlive the created Surface. The win parameter can be used to ensure this.

Creates a Surface from a code:nn::code:vi::code:Layer.

Safety
  • window must be a valid handle.
  • The object referred to by window must outlive the created Surface. The win parameter can be used to ensure this.

Creates a Surface from a Wayland window.

The window’s dimensions will be set to the size of the swapchain.

Safety
  • display and surface must be valid handles.
  • The objects referred to by display and surface must outlive the created Surface. The win parameter can be used to ensure this.

Creates a Surface from a Win32 window.

The surface’s min, max and current extent will always match the window’s dimensions.

Safety
  • hinstance and hwnd must be valid handles.
  • The objects referred to by hwnd and hinstance must outlive the created Surface. The win parameter can be used to ensure this.

Creates a Surface from an XCB window.

The surface’s min, max and current extent will always match the window’s dimensions.

Safety
  • connection and window must be valid handles.
  • The objects referred to by connection and window must outlive the created Surface. The win parameter can be used to ensure this.

Creates a Surface from an Xlib window.

The surface’s min, max and current extent will always match the window’s dimensions.

Safety
  • display and window must be valid handles.
  • The objects referred to by display and window must outlive the created Surface. The win parameter can be used to ensure this.

Returns the instance this surface was created with.

Returns the windowing API that was used to construct the surface.

Returns a reference to the W type parameter that was passed when creating the surface.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type of the object.

Returns a reference to the object.

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.

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.