#[repr(C)]pub struct TransparentPad<T, const PAD: usize>(pub T, _);
Expand description
This type adds some const PAD
number of “explicit” or “manual” padding
bytes to the end of a struct.
This is useful to make a type not have real padding bytes,
and therefore be able to be marked as bytemuck::NoUninit
. Specifically,
it’s used in the ark_api_macros::ffi_union
macro to equalize the size of all
fields of a union and therefore remove any “real” padding bytes from the union, making
it safe to store in WASM memory and pass through the ark module host memory utility functions.
It may also be useful in other places.
Tuple Fields§
§0: T
Implementations§
Trait Implementations§
Source§impl<T, const PAD: usize> AsMut<T> for TransparentPad<T, PAD>
impl<T, const PAD: usize> AsMut<T> for TransparentPad<T, PAD>
Source§impl<T, const PAD: usize> AsRef<T> for TransparentPad<T, PAD>
impl<T, const PAD: usize> AsRef<T> for TransparentPad<T, PAD>
Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<AnimateValue, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<AnimateValue, PAD>
Source§type Bits = TransparentPad<<AnimateValue as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<AnimateValue as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<AnimationReply, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<AnimationReply, PAD>
Source§type Bits = TransparentPad<<AnimationReply as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<AnimationReply as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<AxisInput, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<AxisInput, PAD>
Source§type Bits = TransparentPad<<AxisInput as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<AxisInput as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<CollisionMatrixRow, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<CollisionMatrixRow, PAD>
Source§type Bits = TransparentPad<<CollisionMatrixRow as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<CollisionMatrixRow as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<GamepadButtonInput, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<GamepadButtonInput, PAD>
Source§type Bits = TransparentPad<<GamepadButtonInput as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<GamepadButtonInput as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<KeyInput, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<KeyInput, PAD>
Source§type Bits = TransparentPad<<KeyInput as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<KeyInput as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<MouseInput, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<MouseInput, PAD>
Source§type Bits = TransparentPad<<MouseInput as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<MouseInput as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<OnTrigger, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<OnTrigger, PAD>
Source§type Bits = TransparentPad<<OnTrigger as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<OnTrigger as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<PhysicsForceRequest, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<PhysicsForceRequest, PAD>
Source§type Bits = TransparentPad<<PhysicsForceRequest as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<PhysicsForceRequest as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<PhysicsForceRequest2, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<PhysicsForceRequest2, PAD>
Source§type Bits = TransparentPad<<PhysicsForceRequest2 as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<PhysicsForceRequest2 as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<RawMidiInput, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<RawMidiInput, PAD>
Source§type Bits = TransparentPad<<RawMidiInput as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<RawMidiInput as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<SetActive, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<SetActive, PAD>
Source§type Bits = TransparentPad<<SetActive as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<SetActive as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<SetActiveForPlayer, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<SetActiveForPlayer, PAD>
Source§type Bits = TransparentPad<<SetActiveForPlayer as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<SetActiveForPlayer as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<SetValue, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<SetValue, PAD>
Source§type Bits = TransparentPad<<SetValue as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<SetValue as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<const PAD: usize> CheckedBitPattern for TransparentPad<TouchInput, PAD>
impl<const PAD: usize> CheckedBitPattern for TransparentPad<TouchInput, PAD>
Source§type Bits = TransparentPad<<TouchInput as CheckedBitPattern>::Bits, PAD>
type Bits = TransparentPad<<TouchInput as CheckedBitPattern>::Bits, PAD>
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
fn is_valid_bit_pattern(bits: &Self::Bits) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.Source§impl<T: Clone, const PAD: usize> Clone for TransparentPad<T, PAD>
impl<T: Clone, const PAD: usize> Clone for TransparentPad<T, PAD>
Source§fn clone(&self) -> TransparentPad<T, PAD>
fn clone(&self) -> TransparentPad<T, PAD>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T, const PAD: usize> Deref for TransparentPad<T, PAD>
impl<T, const PAD: usize> Deref for TransparentPad<T, PAD>
Source§impl<T, const PAD: usize> DerefMut for TransparentPad<T, PAD>
impl<T, const PAD: usize> DerefMut for TransparentPad<T, PAD>
impl<T: AnyBitPattern, const PAD: usize> AnyBitPattern for TransparentPad<T, PAD>
impl<T: Copy, const PAD: usize> Copy for TransparentPad<T, PAD>
impl NoUninit for TransparentPad<[f32; 2], __ValueData_data_vec2_PADDING>
impl NoUninit for TransparentPad<[f32; 3], __ValueData_data_vec3_PADDING>
impl NoUninit for TransparentPad<[f32; 4], __ValueData_data_vec4_PADDING>
impl NoUninit for TransparentPad<AnimateValue, __MessagePayload_animate_value_PADDING>
impl NoUninit for TransparentPad<AnimationReply, __MessagePayload_animation_reply_PADDING>
impl NoUninit for TransparentPad<AxisInput, __EventUnion_axis_PADDING>
impl NoUninit for TransparentPad<CollisionMatrixRow, __MessagePayload_collision_matrix_row_PADDING>
impl NoUninit for TransparentPad<GamepadButtonInput, __EventUnion_gamepad_button_PADDING>
impl NoUninit for TransparentPad<KeyInput, __EventUnion_key_PADDING>
impl NoUninit for TransparentPad<MouseInput, __EventUnion_mouse_PADDING>
impl NoUninit for TransparentPad<OnCollision, __MessagePayload_on_collision_PADDING>
impl NoUninit for TransparentPad<OnTrigger, __MessagePayload_on_trigger_PADDING>
impl NoUninit for TransparentPad<PhysicsForceRequest, __MessagePayload_physics_force_request_PADDING>
impl NoUninit for TransparentPad<PhysicsForceRequest2, __MessagePayload_physics_force_request2_PADDING>
impl NoUninit for TransparentPad<PodBool, __ValueData_data_bool_PADDING>
impl NoUninit for TransparentPad<RawMidiInput, __EventUnion_raw_midi_PADDING>
impl NoUninit for TransparentPad<SetActive, __MessagePayload_set_active_PADDING>
impl NoUninit for TransparentPad<SetActiveForPlayer, __MessagePayload_set_active_for_player_PADDING>
impl NoUninit for TransparentPad<SetValue, __MessagePayload_set_value_PADDING>
impl NoUninit for TransparentPad<SpatialQueryBehindPlane, __MessagePayload_spatial_query_behind_plane_PADDING>
impl NoUninit for TransparentPad<SpatialQueryBehindPlane2, __MessagePayload_spatial_query_behind_plane2_PADDING>
impl NoUninit for TransparentPad<SpatialQueryHits, __MessagePayload_spatial_query_hits_PADDING>
impl NoUninit for TransparentPad<SpatialQueryRaycast, __MessagePayload_spatial_query_raycast_PADDING>
impl NoUninit for TransparentPad<SpatialQueryRaycast2, __MessagePayload_spatial_query_raycast2_PADDING>
impl NoUninit for TransparentPad<SpatialQueryResult, __MessagePayload_spatial_query_result_PADDING>
impl NoUninit for TransparentPad<SpatialQuerySpherecast, __MessagePayload_spatial_query_spherecast_PADDING>
impl NoUninit for TransparentPad<SpatialQueryWithinSphere, __MessagePayload_spatial_query_within_sphere_PADDING>
impl NoUninit for TransparentPad<SpatialQueryWithinSphere2, __MessagePayload_spatial_query_within_sphere2_PADDING>
impl NoUninit for TransparentPad<TouchInput, __EventUnion_touch_PADDING>
impl NoUninit for TransparentPad<f32, __ValueData_data_f32_PADDING>
impl NoUninit for TransparentPad<i64, __ValueData_data_i64_PADDING>
impl NoUninit for TransparentPad<u8, __MessagePayload_empty_PADDING>
Auto Trait Implementations§
impl<T, const PAD: usize> Freeze for TransparentPad<T, PAD>where
T: Freeze,
impl<T, const PAD: usize> RefUnwindSafe for TransparentPad<T, PAD>where
T: RefUnwindSafe,
impl<T, const PAD: usize> Send for TransparentPad<T, PAD>where
T: Send,
impl<T, const PAD: usize> Sync for TransparentPad<T, PAD>where
T: Sync,
impl<T, const PAD: usize> Unpin for TransparentPad<T, PAD>where
T: Unpin,
impl<T, const PAD: usize> UnwindSafe for TransparentPad<T, PAD>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.