arena |
|
|
back |
|
|
block.rs |
|
3501 |
compact |
|
|
diagnostic_filter.rs |
[`DiagnosticFilter`]s and supporting functionality. |
3062 |
error.rs |
|
2133 |
front |
|
|
keywords |
|
|
lib.rs |
|
83117 |
non_max_u32.rs |
[`NonMaxU32`], a 32-bit type that can represent any value except [`u32::MAX`].
Naga would like `Option<Handle<T>>` to be a 32-bit value, which means we
need to exclude some index value for use in representing [`None`]. We could
have [`Handle`] store a [`NonZeroU32`], but zero is a very useful value for
indexing. We could have a [`Handle`] store a value one greater than its index,
but it turns out that it's not uncommon to want to work with [`Handle`]s'
indices, so that bias of 1 becomes more visible than one would like.
This module defines the type [`NonMaxU32`], for which `Option<NonMaxU32>` is
still a 32-bit value, but which is directly usable as a [`Handle`] index
type. It still uses a bias of 1 under the hood, but that fact is isolated
within the implementation.
[`Handle`]: crate::arena::Handle
[`NonZeroU32`]: std::num::NonZeroU32 |
5514 |
proc |
|
|
span.rs |
|
14590 |
valid |
|
|