1
0

feat: finish virtools types in bmap-rs

This commit is contained in:
2026-02-15 14:10:42 +08:00
parent 763255d2a7
commit 8e0c6f3793
2 changed files with 483 additions and 1 deletions

View File

@@ -3,9 +3,11 @@
{{ benum.get_enum_comment() | block_comment('/// ') }}
{%- endif %}
{%- if not benum.is_flag() %}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr({% if benum.is_unsigned() -%} u32 {%- else -%} i32 {%- endif %})]
#[non_exhaustive]
#[rustfmt::skip]
#[allow(non_camel_case_types)]
pub enum {{ benum.get_enum_name() }} {
{%- for entry in benum.iter_entries() %}
{%- if entry.get_entry_comment() is not none %}
@@ -17,6 +19,8 @@ pub enum {{ benum.get_enum_name() }} {
{%- else %}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
#[rustfmt::skip]
#[allow(non_camel_case_types)]
pub struct {{ benum.get_enum_name() }}({% if benum.is_unsigned() -%} u32 {%- else -%} i32 {%- endif %});
bitflags! {