pub struct VStack<Store> { /* private fields */ }Implementations§
Source§impl<Store> VStack<Store>
impl<Store> VStack<Store>
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/basic.rs (line 17)
9pub fn main() {
10 let store = Store { count: 127 };
11 let mut app = App::with_store(store);
12 let mut window: Window<Store> = Window::with_size((1200, 600))
13 .title("My first window")
14 .background((255, 255, 127));
15
16 window.set_root_component(
17 VStack::new()
18 .size(Parameter::constant((600, 400)))
19 .padding(Parameter::constant((64, 16)))
20 .background(Parameter::closure(|store: &Store| {
21 (store.count as u8, 0, 0)
22 }))
23 .add_child(VStack::new().background(Parameter::constant((0, 255, 0)))),
24 );
25
26 app.add_window(window);
27 app.run().unwrap();
28}Sourcepub fn add_child<C>(self, component: C) -> Selfwhere
C: Component<Store> + 'static,
pub fn add_child<C>(self, component: C) -> Selfwhere
C: Component<Store> + 'static,
Examples found in repository?
examples/basic.rs (line 23)
9pub fn main() {
10 let store = Store { count: 127 };
11 let mut app = App::with_store(store);
12 let mut window: Window<Store> = Window::with_size((1200, 600))
13 .title("My first window")
14 .background((255, 255, 127));
15
16 window.set_root_component(
17 VStack::new()
18 .size(Parameter::constant((600, 400)))
19 .padding(Parameter::constant((64, 16)))
20 .background(Parameter::closure(|store: &Store| {
21 (store.count as u8, 0, 0)
22 }))
23 .add_child(VStack::new().background(Parameter::constant((0, 255, 0)))),
24 );
25
26 app.add_window(window);
27 app.run().unwrap();
28}Sourcepub fn size(self, size: Parameter<Size, Store>) -> Self
pub fn size(self, size: Parameter<Size, Store>) -> Self
Examples found in repository?
examples/basic.rs (line 18)
9pub fn main() {
10 let store = Store { count: 127 };
11 let mut app = App::with_store(store);
12 let mut window: Window<Store> = Window::with_size((1200, 600))
13 .title("My first window")
14 .background((255, 255, 127));
15
16 window.set_root_component(
17 VStack::new()
18 .size(Parameter::constant((600, 400)))
19 .padding(Parameter::constant((64, 16)))
20 .background(Parameter::closure(|store: &Store| {
21 (store.count as u8, 0, 0)
22 }))
23 .add_child(VStack::new().background(Parameter::constant((0, 255, 0)))),
24 );
25
26 app.add_window(window);
27 app.run().unwrap();
28}Sourcepub fn padding(self, padding: Parameter<Padding, Store>) -> Self
pub fn padding(self, padding: Parameter<Padding, Store>) -> Self
Examples found in repository?
examples/basic.rs (line 19)
9pub fn main() {
10 let store = Store { count: 127 };
11 let mut app = App::with_store(store);
12 let mut window: Window<Store> = Window::with_size((1200, 600))
13 .title("My first window")
14 .background((255, 255, 127));
15
16 window.set_root_component(
17 VStack::new()
18 .size(Parameter::constant((600, 400)))
19 .padding(Parameter::constant((64, 16)))
20 .background(Parameter::closure(|store: &Store| {
21 (store.count as u8, 0, 0)
22 }))
23 .add_child(VStack::new().background(Parameter::constant((0, 255, 0)))),
24 );
25
26 app.add_window(window);
27 app.run().unwrap();
28}Sourcepub fn background(self, fill: Parameter<Color, Store>) -> Self
pub fn background(self, fill: Parameter<Color, Store>) -> Self
Examples found in repository?
examples/basic.rs (lines 20-22)
9pub fn main() {
10 let store = Store { count: 127 };
11 let mut app = App::with_store(store);
12 let mut window: Window<Store> = Window::with_size((1200, 600))
13 .title("My first window")
14 .background((255, 255, 127));
15
16 window.set_root_component(
17 VStack::new()
18 .size(Parameter::constant((600, 400)))
19 .padding(Parameter::constant((64, 16)))
20 .background(Parameter::closure(|store: &Store| {
21 (store.count as u8, 0, 0)
22 }))
23 .add_child(VStack::new().background(Parameter::constant((0, 255, 0)))),
24 );
25
26 app.add_window(window);
27 app.run().unwrap();
28}Trait Implementations§
Auto Trait Implementations§
impl<Store> Freeze for VStack<Store>
impl<Store> !RefUnwindSafe for VStack<Store>
impl<Store> !Send for VStack<Store>
impl<Store> !Sync for VStack<Store>
impl<Store> Unpin for VStack<Store>
impl<Store> !UnwindSafe for VStack<Store>
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