pub struct Field {Show 13 fields
pub address: *mut c_void,
pub name: String,
pub type_info: Type,
pub class: Option<*const Class>,
pub offset: i32,
pub flags: i32,
pub is_static: bool,
pub is_literal: bool,
pub is_readonly: bool,
pub is_not_serialized: bool,
pub is_special_name: bool,
pub is_pinvoke_impl: bool,
pub instance: Option<*mut c_void>,
}Expand description
Hydrated IL2CPP field metadata plus optional bound instance state.
Fields§
§address: *mut c_voidPointer to the internal IL2CPP field structure
name: StringName of the field
type_info: TypeType information of the field
class: Option<*const Class>Class defining this field
offset: i32Offset of the field within the instance
flags: i32Flags associated with the field
is_static: boolWhether the field is static
is_literal: boolWhether the field is constant (literal)
is_readonly: boolWhether the field is readonly (init only)
is_not_serialized: boolWhether the field is not serialized
is_special_name: boolWhether the field has a special name
is_pinvoke_impl: boolWhether the field is pinvoke impl
instance: Option<*mut c_void>Instance pointer for instance fields
Implementations§
Source§impl Field
impl Field
Sourcepub unsafe fn get_value<T: Copy + 'static>(&self) -> Result<T, String>
pub unsafe fn get_value<T: Copy + 'static>(&self) -> Result<T, String>
Reads the current field value.
For instance fields, the field must have a bound instance pointer. Use
crate::structs::Object::field to obtain one.
Sourcepub unsafe fn set_value<T: Copy>(&self, value: T) -> Result<(), String>
pub unsafe fn set_value<T: Copy>(&self, value: T) -> Result<(), String>
Writes a value to the field.
For instance fields, the field must have a bound instance pointer. Use
crate::structs::Object::field to obtain one.