pub struct ObjectFunctions {
pub object_type: ObjectType,
pub count: fn() -> usize,
pub index_to_instance: fn(usize) -> Option<u32>,
pub valid_instance: fn(u32) -> bool,
pub object_name: fn(u32) -> Option<String>,
pub read_property: fn(u32, PropertyIdentifier) -> Result<PropertyValue>,
pub write_property: fn(u32, PropertyIdentifier, PropertyValue) -> Result<()>,
pub is_property_writable: fn(u32, PropertyIdentifier) -> bool,
pub property_list: fn(u32) -> Vec<PropertyIdentifier>,
}Expand description
Object function handlers for a specific object type
This structure provides a function pointer table for all operations that can be performed on objects of a specific type.
Fields§
§object_type: ObjectTypeThe object type these functions handle
count: fn() -> usizeCount the number of instances of this object type
index_to_instance: fn(usize) -> Option<u32>Convert index to instance number
valid_instance: fn(u32) -> boolCheck if an instance number is valid
object_name: fn(u32) -> Option<String>Get the object name for an instance
read_property: fn(u32, PropertyIdentifier) -> Result<PropertyValue>Read a property from an object instance
write_property: fn(u32, PropertyIdentifier, PropertyValue) -> Result<()>Write a property to an object instance
is_property_writable: fn(u32, PropertyIdentifier) -> boolCheck if a property is writable
property_list: fn(u32) -> Vec<PropertyIdentifier>Get the list of properties for an object instance
Trait Implementations§
Source§impl Clone for ObjectFunctions
impl Clone for ObjectFunctions
Source§fn clone(&self) -> ObjectFunctions
fn clone(&self) -> ObjectFunctions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ObjectFunctions
impl RefUnwindSafe for ObjectFunctions
impl Send for ObjectFunctions
impl Sync for ObjectFunctions
impl Unpin for ObjectFunctions
impl UnsafeUnpin for ObjectFunctions
impl UnwindSafe for ObjectFunctions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more