Struct PropertyType
pub struct PropertyType<T> { /* private fields */ }Expand description
An instance of a PropertyType represents a single property type in the Kanzi property system.
A property type exists throughout the lifetime of an application, including the property types
that you create during the runtime of an application.
Implementations§
§impl<T> PropertyType<T>
impl<T> PropertyType<T>
pub const fn as_ptr(&self) -> *mut PropertyTypeWrapper
pub fn get_native(&self) -> Result<NonNull<c_void>, Error>
pub fn get_native(&self) -> Result<NonNull<c_void>, Error>
Gets a pointer to the backing C++ instance.
§impl<T> PropertyType<T>
impl<T> PropertyType<T>
pub fn compare(&self, rhs: &PropertyType<T>) -> Result<bool, Error>
pub fn compare(&self, rhs: &PropertyType<T>) -> Result<bool, Error>
Compares two property types.
pub fn is_inherited(&self) -> Result<bool, Error>
pub fn get_change_flags(&self) -> Result<ChangeFlags, Error>
pub fn get_data_type(&self) -> Result<PropertyDataType, Error>
pub fn get_name(&self) -> Result<KanziString, Error>
pub fn get_name(&self) -> Result<KanziString, Error>
Gets name of the property type.
pub fn get_editor_info(&self) -> Result<Option<EditorInfo>, Error>
pub fn get_editor_info(&self) -> Result<Option<EditorInfo>, Error>
Gets editor info for the property type.
§impl PropertyType<()>
impl PropertyType<()>
pub fn cast<T>(self) -> Result<Option<PropertyType<T>>, Error>where
T: PropertyTypeConstraint,
pub fn cast<T>(self) -> Result<Option<PropertyType<T>>, Error>where
T: PropertyTypeConstraint,
Casts AbstractPropertyType to a more concrete type.
pub fn cast_ref<T>(&self) -> Result<Option<&PropertyType<T>>, Error>where
T: PropertyTypeConstraint,
pub fn cast_ref<T>(&self) -> Result<Option<&PropertyType<T>>, Error>where
T: PropertyTypeConstraint,
Casts AbstractPropertyType reference to a more concrete type.
pub unsafe fn cast_unchecked<T>(self) -> PropertyType<T>where
T: PropertyTypeConstraint,
pub unsafe fn cast_unchecked<T>(self) -> PropertyType<T>where
T: PropertyTypeConstraint,
Casts AbstractPropertyType to a more concrete type.
§Safety
The caller must ensure that T matches the internal property type.
pub unsafe fn cast_ref_unchecked<T>(&self) -> &PropertyType<T>where
T: PropertyTypeConstraint,
pub unsafe fn cast_ref_unchecked<T>(&self) -> &PropertyType<T>where
T: PropertyTypeConstraint,
Casts AbstractPropertyType reference to a more concrete type.
§Safety
The caller must ensure that T matches the internal property type.
§impl<T> PropertyType<T>where
T: PropertyTypeConstraint,
impl<T> PropertyType<T>where
T: PropertyTypeConstraint,
pub fn as_abstract(&self) -> &PropertyType<()>
pub fn as_abstract(&self) -> &PropertyType<()>
Casts a PropertyType reference to its abstract representation.
pub fn to_abstract(self) -> PropertyType<()>
pub fn to_abstract(self) -> PropertyType<()>
Casts a PropertyType to its abstract representation.
Useful for returning a typed PropertyType in callbacks that expect a generic PropertyType.
pub fn get_default_value(
&self,
) -> Result<<T as VariantConstraint>::RetArg, Error>
pub fn get_default_value( &self, ) -> Result<<T as VariantConstraint>::RetArg, Error>
Gets the default value of a property type. When no other value is available, property functions return the default value.
pub fn find(
domain: &Domain,
name: impl AsRef<KanziStr>,
) -> Result<PropertyType<T>, Error>
pub fn find( domain: &Domain, name: impl AsRef<KanziStr>, ) -> Result<PropertyType<T>, Error>
Finds a registered property type by name.
§Errors
Returns an OBJECT_NOT_FOUND error if the property is not found, or a TYPE_MISMATCH error
if the property exists but cannot be cast to the required type.
Trait Implementations§
§impl<T> Clone for PropertyType<T>
impl<T> Clone for PropertyType<T>
§fn clone(&self) -> PropertyType<T>
fn clone(&self) -> PropertyType<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more