classfile_parser/field_info/
types.rs

1use attribute_info::AttributeInfo;
2
3#[derive(Clone, Debug)]
4pub struct FieldInfo {
5    pub access_flags: FieldAccessFlags,
6    pub name_index: u16,
7    pub descriptor_index: u16,
8    pub attributes_count: u16,
9    pub attributes: Vec<AttributeInfo>,
10}
11
12bitflags! {
13    #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
14    pub struct FieldAccessFlags: u16 {
15        const PUBLIC = 0x0001;     // 	Declared public; may be accessed from outside its package.
16        const PRIVATE = 0x0002;    // 	Declared private; usable only within the defining class.
17        const PROTECTED = 0x0004;  // 	Declared protected; may be accessed within subclasses.
18        const STATIC = 0x0008;     // 	Declared static.
19        const FINAL = 0x0010;      // 	Declared final; never directly assigned to after object construction.
20        const VOLATILE = 0x0040;   // 	Declared volatile; cannot be cached.
21        const TRANSIENT = 0x0080;  // 	Declared transient; not written or read by a persistent object manager.
22        const SYNTHETIC = 0x1000;  // 	Declared synthetic; not present in the source code.
23        const ANNOTATION = 0x2000; // 	Declared as an annotation type.
24        const ENUM = 0x4000;       // 	Declared as an element of an enum.
25    }
26}
27
28#[cfg(test)]
29trait TraitTester:
30    Copy + Clone + PartialEq + Eq + PartialOrd + Ord + ::std::hash::Hash + ::std::fmt::Debug
31{
32}
33
34#[cfg(test)]
35impl TraitTester for FieldAccessFlags {}