wgpu

Module api

source
Expand description

Types and functions which define our public api and their helper functionality.

§Conventions

Each major type gets its own module. The module is laid out as follows:

  • The type itself
  • impl block for the type
  • Drop implementation for the type (if needed)
  • Descriptor types and their subtypes.
  • Any non-public helper types or functions.

§Imports

Because our public api is “flat” (i.e. all types are directly under the wgpu module), we use a single crate::* import at the top of each module to bring in all the types in the public api. This is done to:

  • Avoid having to write out a long list of imports for each module.
  • Allow docs to be written naturally, without needing to worry about needing dedicated doc imports.
  • Treat wgpu-types types and wgpu-core types as a single set.

Re-exports§

Modules§

Structs§

  • A cute utility type that works just like PhantomData, but also implements Drop. This forces any lifetimes that are associated with the type to be used until the Drop impl is ran. This prevents lifetimes from being shortened.

Type Aliases§

  • Object debugging label.