[][src]Struct sciter::om::som_passport_t

#[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>,
}

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

impl Default for som_passport_t[src]

Empty passport.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.