pub(crate) mod __private { #[cfg(feature = "serde")] pubuse serde;
#[cfg(feature = "arbitrary")] pubuse arbitrary;
#[cfg(feature = "bytemuck")] pubuse bytemuck;
}
/// Implements traits from external libraries for the internal bitflags type. #[macro_export] #[doc(hidden)]
macro_rules! __impl_external_bitflags {
(
$InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
$(
$(#[$inner:ident $($args:tt)*])* const $Flag:tt;
)*
}
) => { // Any new library traits impls should be added here // Use `serde` as an example: generate code when the feature is available, // and a no-op when it isn't
/// Implement `Pod` and `Zeroable` for the internal bitflags type. #[macro_export] #[doc(hidden)] #[cfg(feature = "bytemuck")]
macro_rules! __impl_external_bitflags_bytemuck {
(
$InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident {
$(
$(#[$inner:ident $($args:tt)*])* const $Flag:tt;
)*
}
) => { // SAFETY: $InternalBitFlags is guaranteed to have the same ABI as $T, // and $T implements Pod unsafeimpl $crate::__private::bytemuck::Pod for $InternalBitFlags where
$T: $crate::__private::bytemuck::Pod
{
}
// SAFETY: $InternalBitFlags is guaranteed to have the same ABI as $T, // and $T implements Zeroable unsafeimpl $crate::__private::bytemuck::Zeroable for $InternalBitFlags where
$T: $crate::__private::bytemuck::Zeroable
{
}
};
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.