pub struct ModelType { /* private fields */ }Expand description
The binding metadata of a model type: a type outside the class hierarchy (typically a view model) that bindings with a string path can navigate.
This is what stands in for reflection: the properties and methods a type declares by name, and how to reach the notification interfaces it implements from an untyped value.
Implementations§
Source§impl ModelType
impl ModelType
pub fn value_type(&self) -> ValueType
Sourcepub fn properties(&self) -> &[Rc<dyn IPropertyInfo>]
pub fn properties(&self) -> &[Rc<dyn IPropertyInfo>]
The declared properties.
Sourcepub fn find_property(&self, name: &str) -> Option<Rc<dyn IPropertyInfo>>
pub fn find_property(&self, name: &str) -> Option<Rc<dyn IPropertyInfo>>
Finds a declared property by name.
Sourcepub fn find_method(&self, name: &str) -> Option<Rc<ModelMethod>>
pub fn find_method(&self, name: &str) -> Option<Rc<ModelMethod>>
Finds a declared method by name.
Sourcepub fn as_notify_property_changed<'a>(
&self,
value: &'a dyn AnyValue,
) -> Option<&'a dyn INotifyPropertyChanged>
pub fn as_notify_property_changed<'a>( &self, value: &'a dyn AnyValue, ) -> Option<&'a dyn INotifyPropertyChanged>
The property change notifications of value, if its type declared
them.
Sourcepub fn as_notify_data_error_info<'a>(
&self,
value: &'a dyn AnyValue,
) -> Option<&'a dyn INotifyDataErrorInfo>
pub fn as_notify_data_error_info<'a>( &self, value: &'a dyn AnyValue, ) -> Option<&'a dyn INotifyDataErrorInfo>
The validation error notifications of value, if its type declared
them.
Sourcepub fn as_list<'a>(
&self,
value: &'a dyn AnyValue,
) -> Option<&'a dyn IBindableList>
pub fn as_list<'a>( &self, value: &'a dyn AnyValue, ) -> Option<&'a dyn IBindableList>
Indexed access to value, if its type declared itself a list.
Sourcepub fn as_indexer<'a>(
&self,
value: &'a dyn AnyValue,
) -> Option<&'a dyn IBindableIndexer>
pub fn as_indexer<'a>( &self, value: &'a dyn AnyValue, ) -> Option<&'a dyn IBindableIndexer>
The indexer of value, if its type declared one.
Sourcepub fn as_array<'a>(
&self,
value: &'a dyn AnyValue,
) -> Option<&'a dyn IBindableArray>
pub fn as_array<'a>( &self, value: &'a dyn AnyValue, ) -> Option<&'a dyn IBindableArray>
Array access to value, if its type declared itself an array.
Sourcepub fn as_notify_collection_changed<'a>(
&self,
value: &'a dyn AnyValue,
) -> Option<&'a dyn INotifyCollectionChanged>
pub fn as_notify_collection_changed<'a>( &self, value: &'a dyn AnyValue, ) -> Option<&'a dyn INotifyCollectionChanged>
The collection change notifications of value, if its type declared
them or is a notifying list.
Auto Trait Implementations§
impl !RefUnwindSafe for ModelType
impl !Send for ModelType
impl !Sync for ModelType
impl !UnwindSafe for ModelType
impl Freeze for ModelType
impl Unpin for ModelType
impl UnsafeUnpin for ModelType
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more