pub struct NodeBuilder { /* private fields */ }Implementations§
Source§impl NodeBuilder
impl NodeBuilder
pub fn new(node_type: impl Into<String>) -> Self
Sourcepub fn position(self, x: f32, y: f32) -> Self
pub fn position(self, x: f32, y: f32) -> Self
Examples found in repository?
examples/extension.rs (line 13)
7fn main() {
8 Application::new().run(|cx| {
9 let mut graph = Graph::new();
10
11 graph
12 .create_node("number")
13 .position(100.0, 100.0)
14 .size(300.0, 150.0)
15 .output()
16 .build(&mut graph);
17
18 graph
19 .create_node("")
20 .position(300.0, 400.0)
21 .input()
22 .build(&mut graph);
23
24 cx.open_window(WindowOptions::default(), |_, cx| {
25 cx.new(|fc| {
26 let mut flow = FlowCanvas::new(graph, fc)
27 .plugin(SelectionPlugin::new())
28 .plugin(NodeInteractionPlugin::new())
29 .plugin(ViewportPlugin::new())
30 .plugin(Background::new())
31 .plugin(NodePlugin::new().register_node("number", NumberNode {}));
32 flow.init_plugins();
33 flow
34 })
35 })
36 .unwrap();
37 });
38}More examples
examples/bench.rs (line 12)
4fn main() {
5 Application::new().run(|cx| {
6 let mut graph = Graph::new();
7
8 for j in 0..100 {
9 for i in 0..100 {
10 graph
11 .create_node("")
12 .position(200.0 * i as f32, 200.0 * j as f32)
13 .input()
14 .output()
15 .build(&mut graph);
16 }
17 }
18
19 cx.open_window(WindowOptions::default(), |_, cx| {
20 cx.new(|fc| {
21 let mut flow = FlowCanvas::new(graph, fc)
22 .plugin(SelectionPlugin::new())
23 .plugin(NodeInteractionPlugin::new())
24 .plugin(ViewportPlugin::new())
25 .plugin(Background::new())
26 .plugin(NodePlugin::new())
27 .plugin(PortInteractionPlugin::new())
28 .plugin(EdgePlugin::new())
29 .plugin(DeletePlugin::new())
30 .plugin(HistoryPlugin::new());
31 flow.init_plugins();
32 flow
33 })
34 })
35 .unwrap();
36 });
37}examples/basic.rs (line 10)
4fn main() {
5 Application::new().run(|cx| {
6 let mut graph = Graph::new();
7
8 graph
9 .create_node("")
10 .position(100.0, 100.0)
11 .output()
12 .build(&mut graph);
13
14 graph
15 .create_node("")
16 .position(300.0, 400.0)
17 .input()
18 .output()
19 .build(&mut graph);
20
21 graph
22 .create_node("")
23 .position(500.0, 500.0)
24 .input()
25 .output()
26 .build(&mut graph);
27
28 cx.open_window(WindowOptions::default(), |_, cx| {
29 cx.new(|fc| {
30 let mut flow = FlowCanvas::new(graph, fc)
31 .plugin(SelectionPlugin::new())
32 .plugin(NodeInteractionPlugin::new())
33 .plugin(ViewportPlugin::new())
34 .plugin(Background::new())
35 .plugin(NodePlugin::new())
36 .plugin(PortInteractionPlugin::new())
37 .plugin(EdgePlugin::new())
38 .plugin(DeletePlugin::new())
39 .plugin(HistoryPlugin::new());
40 flow.init_plugins();
41 flow
42 })
43 })
44 .unwrap();
45 });
46}Sourcepub fn size(self, w: f32, h: f32) -> Self
pub fn size(self, w: f32, h: f32) -> Self
Examples found in repository?
examples/extension.rs (line 14)
7fn main() {
8 Application::new().run(|cx| {
9 let mut graph = Graph::new();
10
11 graph
12 .create_node("number")
13 .position(100.0, 100.0)
14 .size(300.0, 150.0)
15 .output()
16 .build(&mut graph);
17
18 graph
19 .create_node("")
20 .position(300.0, 400.0)
21 .input()
22 .build(&mut graph);
23
24 cx.open_window(WindowOptions::default(), |_, cx| {
25 cx.new(|fc| {
26 let mut flow = FlowCanvas::new(graph, fc)
27 .plugin(SelectionPlugin::new())
28 .plugin(NodeInteractionPlugin::new())
29 .plugin(ViewportPlugin::new())
30 .plugin(Background::new())
31 .plugin(NodePlugin::new().register_node("number", NumberNode {}));
32 flow.init_plugins();
33 flow
34 })
35 })
36 .unwrap();
37 });
38}Sourcepub fn input(self) -> Self
pub fn input(self) -> Self
Examples found in repository?
examples/extension.rs (line 21)
7fn main() {
8 Application::new().run(|cx| {
9 let mut graph = Graph::new();
10
11 graph
12 .create_node("number")
13 .position(100.0, 100.0)
14 .size(300.0, 150.0)
15 .output()
16 .build(&mut graph);
17
18 graph
19 .create_node("")
20 .position(300.0, 400.0)
21 .input()
22 .build(&mut graph);
23
24 cx.open_window(WindowOptions::default(), |_, cx| {
25 cx.new(|fc| {
26 let mut flow = FlowCanvas::new(graph, fc)
27 .plugin(SelectionPlugin::new())
28 .plugin(NodeInteractionPlugin::new())
29 .plugin(ViewportPlugin::new())
30 .plugin(Background::new())
31 .plugin(NodePlugin::new().register_node("number", NumberNode {}));
32 flow.init_plugins();
33 flow
34 })
35 })
36 .unwrap();
37 });
38}More examples
examples/bench.rs (line 13)
4fn main() {
5 Application::new().run(|cx| {
6 let mut graph = Graph::new();
7
8 for j in 0..100 {
9 for i in 0..100 {
10 graph
11 .create_node("")
12 .position(200.0 * i as f32, 200.0 * j as f32)
13 .input()
14 .output()
15 .build(&mut graph);
16 }
17 }
18
19 cx.open_window(WindowOptions::default(), |_, cx| {
20 cx.new(|fc| {
21 let mut flow = FlowCanvas::new(graph, fc)
22 .plugin(SelectionPlugin::new())
23 .plugin(NodeInteractionPlugin::new())
24 .plugin(ViewportPlugin::new())
25 .plugin(Background::new())
26 .plugin(NodePlugin::new())
27 .plugin(PortInteractionPlugin::new())
28 .plugin(EdgePlugin::new())
29 .plugin(DeletePlugin::new())
30 .plugin(HistoryPlugin::new());
31 flow.init_plugins();
32 flow
33 })
34 })
35 .unwrap();
36 });
37}examples/basic.rs (line 17)
4fn main() {
5 Application::new().run(|cx| {
6 let mut graph = Graph::new();
7
8 graph
9 .create_node("")
10 .position(100.0, 100.0)
11 .output()
12 .build(&mut graph);
13
14 graph
15 .create_node("")
16 .position(300.0, 400.0)
17 .input()
18 .output()
19 .build(&mut graph);
20
21 graph
22 .create_node("")
23 .position(500.0, 500.0)
24 .input()
25 .output()
26 .build(&mut graph);
27
28 cx.open_window(WindowOptions::default(), |_, cx| {
29 cx.new(|fc| {
30 let mut flow = FlowCanvas::new(graph, fc)
31 .plugin(SelectionPlugin::new())
32 .plugin(NodeInteractionPlugin::new())
33 .plugin(ViewportPlugin::new())
34 .plugin(Background::new())
35 .plugin(NodePlugin::new())
36 .plugin(PortInteractionPlugin::new())
37 .plugin(EdgePlugin::new())
38 .plugin(DeletePlugin::new())
39 .plugin(HistoryPlugin::new());
40 flow.init_plugins();
41 flow
42 })
43 })
44 .unwrap();
45 });
46}Sourcepub fn output(self) -> Self
pub fn output(self) -> Self
Examples found in repository?
examples/extension.rs (line 15)
7fn main() {
8 Application::new().run(|cx| {
9 let mut graph = Graph::new();
10
11 graph
12 .create_node("number")
13 .position(100.0, 100.0)
14 .size(300.0, 150.0)
15 .output()
16 .build(&mut graph);
17
18 graph
19 .create_node("")
20 .position(300.0, 400.0)
21 .input()
22 .build(&mut graph);
23
24 cx.open_window(WindowOptions::default(), |_, cx| {
25 cx.new(|fc| {
26 let mut flow = FlowCanvas::new(graph, fc)
27 .plugin(SelectionPlugin::new())
28 .plugin(NodeInteractionPlugin::new())
29 .plugin(ViewportPlugin::new())
30 .plugin(Background::new())
31 .plugin(NodePlugin::new().register_node("number", NumberNode {}));
32 flow.init_plugins();
33 flow
34 })
35 })
36 .unwrap();
37 });
38}More examples
examples/bench.rs (line 14)
4fn main() {
5 Application::new().run(|cx| {
6 let mut graph = Graph::new();
7
8 for j in 0..100 {
9 for i in 0..100 {
10 graph
11 .create_node("")
12 .position(200.0 * i as f32, 200.0 * j as f32)
13 .input()
14 .output()
15 .build(&mut graph);
16 }
17 }
18
19 cx.open_window(WindowOptions::default(), |_, cx| {
20 cx.new(|fc| {
21 let mut flow = FlowCanvas::new(graph, fc)
22 .plugin(SelectionPlugin::new())
23 .plugin(NodeInteractionPlugin::new())
24 .plugin(ViewportPlugin::new())
25 .plugin(Background::new())
26 .plugin(NodePlugin::new())
27 .plugin(PortInteractionPlugin::new())
28 .plugin(EdgePlugin::new())
29 .plugin(DeletePlugin::new())
30 .plugin(HistoryPlugin::new());
31 flow.init_plugins();
32 flow
33 })
34 })
35 .unwrap();
36 });
37}examples/basic.rs (line 11)
4fn main() {
5 Application::new().run(|cx| {
6 let mut graph = Graph::new();
7
8 graph
9 .create_node("")
10 .position(100.0, 100.0)
11 .output()
12 .build(&mut graph);
13
14 graph
15 .create_node("")
16 .position(300.0, 400.0)
17 .input()
18 .output()
19 .build(&mut graph);
20
21 graph
22 .create_node("")
23 .position(500.0, 500.0)
24 .input()
25 .output()
26 .build(&mut graph);
27
28 cx.open_window(WindowOptions::default(), |_, cx| {
29 cx.new(|fc| {
30 let mut flow = FlowCanvas::new(graph, fc)
31 .plugin(SelectionPlugin::new())
32 .plugin(NodeInteractionPlugin::new())
33 .plugin(ViewportPlugin::new())
34 .plugin(Background::new())
35 .plugin(NodePlugin::new())
36 .plugin(PortInteractionPlugin::new())
37 .plugin(EdgePlugin::new())
38 .plugin(DeletePlugin::new())
39 .plugin(HistoryPlugin::new());
40 flow.init_plugins();
41 flow
42 })
43 })
44 .unwrap();
45 });
46}pub fn data(self, data: Value) -> Self
Sourcepub fn build(self, graph: &mut Graph) -> NodeId
pub fn build(self, graph: &mut Graph) -> NodeId
Examples found in repository?
examples/extension.rs (line 16)
7fn main() {
8 Application::new().run(|cx| {
9 let mut graph = Graph::new();
10
11 graph
12 .create_node("number")
13 .position(100.0, 100.0)
14 .size(300.0, 150.0)
15 .output()
16 .build(&mut graph);
17
18 graph
19 .create_node("")
20 .position(300.0, 400.0)
21 .input()
22 .build(&mut graph);
23
24 cx.open_window(WindowOptions::default(), |_, cx| {
25 cx.new(|fc| {
26 let mut flow = FlowCanvas::new(graph, fc)
27 .plugin(SelectionPlugin::new())
28 .plugin(NodeInteractionPlugin::new())
29 .plugin(ViewportPlugin::new())
30 .plugin(Background::new())
31 .plugin(NodePlugin::new().register_node("number", NumberNode {}));
32 flow.init_plugins();
33 flow
34 })
35 })
36 .unwrap();
37 });
38}More examples
examples/bench.rs (line 15)
4fn main() {
5 Application::new().run(|cx| {
6 let mut graph = Graph::new();
7
8 for j in 0..100 {
9 for i in 0..100 {
10 graph
11 .create_node("")
12 .position(200.0 * i as f32, 200.0 * j as f32)
13 .input()
14 .output()
15 .build(&mut graph);
16 }
17 }
18
19 cx.open_window(WindowOptions::default(), |_, cx| {
20 cx.new(|fc| {
21 let mut flow = FlowCanvas::new(graph, fc)
22 .plugin(SelectionPlugin::new())
23 .plugin(NodeInteractionPlugin::new())
24 .plugin(ViewportPlugin::new())
25 .plugin(Background::new())
26 .plugin(NodePlugin::new())
27 .plugin(PortInteractionPlugin::new())
28 .plugin(EdgePlugin::new())
29 .plugin(DeletePlugin::new())
30 .plugin(HistoryPlugin::new());
31 flow.init_plugins();
32 flow
33 })
34 })
35 .unwrap();
36 });
37}examples/basic.rs (line 12)
4fn main() {
5 Application::new().run(|cx| {
6 let mut graph = Graph::new();
7
8 graph
9 .create_node("")
10 .position(100.0, 100.0)
11 .output()
12 .build(&mut graph);
13
14 graph
15 .create_node("")
16 .position(300.0, 400.0)
17 .input()
18 .output()
19 .build(&mut graph);
20
21 graph
22 .create_node("")
23 .position(500.0, 500.0)
24 .input()
25 .output()
26 .build(&mut graph);
27
28 cx.open_window(WindowOptions::default(), |_, cx| {
29 cx.new(|fc| {
30 let mut flow = FlowCanvas::new(graph, fc)
31 .plugin(SelectionPlugin::new())
32 .plugin(NodeInteractionPlugin::new())
33 .plugin(ViewportPlugin::new())
34 .plugin(Background::new())
35 .plugin(NodePlugin::new())
36 .plugin(PortInteractionPlugin::new())
37 .plugin(EdgePlugin::new())
38 .plugin(DeletePlugin::new())
39 .plugin(HistoryPlugin::new());
40 flow.init_plugins();
41 flow
42 })
43 })
44 .unwrap();
45 });
46}Auto Trait Implementations§
impl Freeze for NodeBuilder
impl RefUnwindSafe for NodeBuilder
impl Send for NodeBuilder
impl Sync for NodeBuilder
impl Unpin for NodeBuilder
impl UnsafeUnpin for NodeBuilder
impl UnwindSafe for NodeBuilder
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more