Struct sciter::om::som_passport_t
source · [−]#[repr(C)]pub struct som_passport_t {
pub flags: u64,
pub name: som_atom_t,
pub properties: *const som_property_def_t,
pub n_properties: usize,
pub methods: *const som_method_def_t,
pub n_methods: usize,
pub item_getter: Option<extern "C" fn(thing: *mut som_asset_t, p_key: &VALUE, p_value: &mut VALUE) -> BOOL>,
pub item_setter: Option<extern "C" fn(thing: *mut som_asset_t, p_key: &VALUE, p_value: &VALUE) -> BOOL>,
pub item_next: Option<extern "C" fn(thing: *mut som_asset_t, p_idx: &mut VALUE, p_value: &mut VALUE) -> BOOL>,
pub prop_getter: Option<extern "C" fn(thing: *mut som_asset_t, propSymbol: som_atom_t, p_value: &mut VALUE) -> BOOL>,
pub prop_setter: Option<extern "C" fn(thing: *mut som_asset_t, propSymbol: som_atom_t, p_value: &VALUE) -> BOOL>,
}
Expand description
Defines properties and methods of an asset.
Fields
flags: u64
Flags of an asset, see som_passport_flags
.
name: som_atom_t
The name of the class (asset type).
properties: *const som_property_def_t
Properties: asset.prop
.
Must be a pointer to an array of structures:
let mut pst = Box::new(som_passport_t::default());
type ObjectProps = [som_property_def_t; 2];
let mut props = Box::new(ObjectProps::default());
let mut prop1 = &mut props[0];
prop1.name = atom("age");
let mut prop2 = &mut props[1];
prop2.name = atom("name");
pst.n_properties = 2;
pst.properties = Box::into_raw(props) as *const _;
n_properties: usize
Properties count.
methods: *const som_method_def_t
Methods: asset.func()
Must be a pointer to an array of structures,
see properties
for an example.
n_methods: usize
Methods count.
item_getter: Option<extern "C" fn(thing: *mut som_asset_t, p_key: &VALUE, p_value: &mut VALUE) -> BOOL>
Index access: var item = asset[key]
.
item_setter: Option<extern "C" fn(thing: *mut som_asset_t, p_key: &VALUE, p_value: &VALUE) -> BOOL>
Index access: asset[key] = item
.
item_next: Option<extern "C" fn(thing: *mut som_asset_t, p_idx: &mut VALUE, p_value: &mut VALUE) -> BOOL>
Enumeration: for(var item in asset)
.
prop_getter: Option<extern "C" fn(thing: *mut som_asset_t, propSymbol: som_atom_t, p_value: &mut VALUE) -> BOOL>
Property access interceptor: var val = asset.prop
.
prop_setter: Option<extern "C" fn(thing: *mut som_asset_t, propSymbol: som_atom_t, p_value: &VALUE) -> BOOL>
Property set interceptor: asset.prop = val
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for som_passport_t
impl !Send for som_passport_t
impl !Sync for som_passport_t
impl Unpin for som_passport_t
impl UnwindSafe for som_passport_t
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more