pub enum Children {
None,
SingleStatic(Rc<RefCell<dyn ControlObject>>),
MultipleStatic(Vec<Rc<RefCell<dyn ControlObject>>>),
SingleDynamic(Box<dyn ObservableCollection<Rc<RefCell<dyn ControlObject>>>>),
}
Expand description
Children is a collection of controls.
The collection is an enum to make it optimized for the cases with having static list of controls.
Variants§
None
The collection has no items.
SingleStatic(Rc<RefCell<dyn ControlObject>>)
The collection has a single child.
MultipleStatic(Vec<Rc<RefCell<dyn ControlObject>>>)
The collection is a list of controls.
SingleDynamic(Box<dyn ObservableCollection<Rc<RefCell<dyn ControlObject>>>>)
The children comes from a single observable collection.
Implementations§
Trait Implementations§
source§impl<T: ControlObject + 'static> From<Rc<RefCell<T>>> for Children
impl<T: ControlObject + 'static> From<Rc<RefCell<T>>> for Children
Converts a single control to Children collection.
source§impl From<Rc<RefCell<dyn ControlObject>>> for Children
impl From<Rc<RefCell<dyn ControlObject>>> for Children
Converts a single control to Children collection.
source§impl<T: Into<Box<dyn ObservableCollection<Rc<RefCell<dyn ControlObject>>>>>> From<T> for Children
impl<T: Into<Box<dyn ObservableCollection<Rc<RefCell<dyn ControlObject>>>>>> From<T> for Children
Converts an observable collection to Children collection.
source§impl<T: 'static + ControlObject> From<Vec<Rc<RefCell<T>>>> for Children
impl<T: 'static + ControlObject> From<Vec<Rc<RefCell<T>>>> for Children
Converts vector of controls to Children collection.
source§impl From<Vec<Rc<RefCell<dyn ControlObject>>>> for Children
impl From<Vec<Rc<RefCell<dyn ControlObject>>>> for Children
Converts vector of controls to Children collection.
source§impl<'a> IntoIterator for &'a Children
impl<'a> IntoIterator for &'a Children
§type Item = Rc<RefCell<dyn ControlObject>>
type Item = Rc<RefCell<dyn ControlObject>>
§type IntoIter = ChildrenIterator<'a>
type IntoIter = ChildrenIterator<'a>
source§impl ObservableCollection<Rc<RefCell<dyn ControlObject>>> for Children
impl ObservableCollection<Rc<RefCell<dyn ControlObject>>> for Children
ObservableCollection for Children.
Auto Trait Implementations§
impl Freeze for Children
impl !RefUnwindSafe for Children
impl !Send for Children
impl !Sync for Children
impl Unpin for Children
impl !UnwindSafe for Children
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, TSrcColl> ObservableCollectionExt<T> for TSrcCollwhere
T: 'static + Clone,
TSrcColl: ObservableCollection<T> + 'static,
impl<T, TSrcColl> ObservableCollectionExt<T> for TSrcCollwhere
T: 'static + Clone,
TSrcColl: ObservableCollection<T> + 'static,
source§fn map<TDst, F>(&self, f: F) -> ObservableCollectionMap<TDst>
fn map<TDst, F>(&self, f: F) -> ObservableCollectionMap<TDst>
Map creates new observable collection.
It keeps mapped copy of every item.
The only connection between it and original observable collection
is by subscribing on the on_changed
event of the source collection,
so we don’t have to keep implicit reference to the source collection.
The on_change
event of source collection keeps a weak reference to our handler.
source§impl<TSrc, TSrcColl> ObservableCollectionFlatMapExt<TSrc> for TSrcCollwhere
TSrc: Clone + 'static,
TSrcColl: ObservableCollection<TSrc> + 'static,
impl<TSrc, TSrcColl> ObservableCollectionFlatMapExt<TSrc> for TSrcCollwhere
TSrc: Clone + 'static,
TSrcColl: ObservableCollection<TSrc> + 'static,
source§fn flat_map<TDst, TDstColl, F>(&self, f: F) -> ObservableCollectionFlatMap<TDst>where
TDst: Clone + 'static,
TDstColl: ObservableCollection<TDst> + IntoIterator<Item = TDst>,
F: FnMut(&TSrc) -> TDstColl + 'static,
fn flat_map<TDst, TDstColl, F>(&self, f: F) -> ObservableCollectionFlatMap<TDst>where
TDst: Clone + 'static,
TDstColl: ObservableCollection<TDst> + IntoIterator<Item = TDst>,
F: FnMut(&TSrc) -> TDstColl + 'static,
Flat map creates new observable collection.
It keeps mapped copy of every item.
The only connection between it and original observable collection
is by subscribing on the on_changed
event of the source collection,
so we don’t have to keep implicit reference to the source collection.
The on_change
event of source collection keeps a weak reference to our handler.