pub struct FactoryHashMapBuilder<K, C: FactoryComponent, S = RandomState> { /* private fields */ }Expand description
A builder-pattern struct for building a FactoryHashMap.
Implementations§
Source§impl<K, C> FactoryHashMapBuilder<K, C>
impl<K, C> FactoryHashMapBuilder<K, C>
Sourcepub fn launch_default(self) -> FactoryHashMapConnector<K, C>
pub fn launch_default(self) -> FactoryHashMapConnector<K, C>
Launch the factory with a default parent widget.
Examples found in repository?
relm4/examples/factory_hash_map.rs (line 149)
144 fn init(
145 counter: Self::Init,
146 root: Self::Root,
147 sender: ComponentSender<Self>,
148 ) -> ComponentParts<Self> {
149 let counters = FactoryHashMap::builder().launch_default().detach();
150
151 let model = App {
152 created_widgets: counter,
153 counters,
154 entry_buffer: gtk::EntryBuffer::default(),
155 };
156
157 let counter_stack = model.counters.widget();
158 let widgets = view_output!();
159
160 ComponentParts { model, widgets }
161 }Source§impl<K, C> FactoryHashMapBuilder<K, C>where
C: FactoryComponent,
impl<K, C> FactoryHashMapBuilder<K, C>where
C: FactoryComponent,
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new FactoryHashMapBuilder.
Sourcepub fn hasher<H: Hasher>(self, hasher: H) -> FactoryHashMapBuilder<K, C, H>
pub fn hasher<H: Hasher>(self, hasher: H) -> FactoryHashMapBuilder<K, C, H>
Sets a different hasher.
Sourcepub fn launch(self, widget: C::ParentWidget) -> FactoryHashMapConnector<K, C>
pub fn launch(self, widget: C::ParentWidget) -> FactoryHashMapConnector<K, C>
Launch the factory.
This is similar to Connector::launch.
Trait Implementations§
Source§impl<K: Debug, C: Debug + FactoryComponent, S: Debug> Debug for FactoryHashMapBuilder<K, C, S>
impl<K: Debug, C: Debug + FactoryComponent, S: Debug> Debug for FactoryHashMapBuilder<K, C, S>
Source§impl<K, C> Default for FactoryHashMapBuilder<K, C>where
C: FactoryComponent,
impl<K, C> Default for FactoryHashMapBuilder<K, C>where
C: FactoryComponent,
Auto Trait Implementations§
impl<K, C, S> Freeze for FactoryHashMapBuilder<K, C, S>where
S: Freeze,
impl<K, C, S> RefUnwindSafe for FactoryHashMapBuilder<K, C, S>
impl<K, C, S> Send for FactoryHashMapBuilder<K, C, S>
impl<K, C, S> Sync for FactoryHashMapBuilder<K, C, S>
impl<K, C, S> Unpin for FactoryHashMapBuilder<K, C, S>
impl<K, C, S> UnwindSafe for FactoryHashMapBuilder<K, C, S>
Blanket Implementations§
Source§impl<C> AsyncPosition<()> for C
impl<C> AsyncPosition<()> for C
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