pub struct Series { /* private fields */ }Expand description
Plot series with data storage and styling.
Series own their data and provide append-only methods for streaming workloads. All axes and transforms are handled at the plot level.
Use Series::share when multiple plots should observe the same live
append-only stream. By contrast, Clone creates an independent copy.
Implementations§
Source§impl Series
impl Series
Sourcepub fn line(name: impl Into<String>) -> Self
pub fn line(name: impl Into<String>) -> Self
Create a line series with indexed data.
Indexed data uses implicit X values (0, 1, 2, …).
Examples found in repository?
34fn build_views(
35 cx: &mut gpui::App,
36) -> (
37 gpui::Entity<PlotView>,
38 gpui::Entity<PlotView>,
39 Series,
40 Series,
41) {
42 let mut stream_a = Series::line("stream-A").with_kind(SeriesKind::Line(LineStyle {
43 color: Rgba {
44 r: 0.2,
45 g: 0.82,
46 b: 0.95,
47 a: 1.0,
48 },
49 width: 2.0,
50 }));
51 let mut stream_b = Series::line("stream-B").with_kind(SeriesKind::Line(LineStyle {
52 color: Rgba {
53 r: 0.95,
54 g: 0.64,
55 b: 0.28,
56 a: 1.0,
57 },
58 width: 2.0,
59 }));
60
61 for i in 0..1_000 {
62 let phase = i as f64 * 0.02;
63 let _ = stream_a.push_y((phase * 0.9).sin() + 0.2 * (phase * 0.13).cos());
64 let _ = stream_b.push_y((phase * 0.45).cos() * 1.15 + 0.15 * (phase * 0.09).sin());
65 }
66
67 let events = Series::from_iter_points(
68 "events(scatter)",
69 (0..200).map(|i| {
70 let x = i as f64 * 80.0 + 40.0;
71 let y = (x * 0.02).sin() * 0.9;
72 gpui_liveplot::Point::new(x, y)
73 }),
74 SeriesKind::Scatter(MarkerStyle {
75 color: Rgba {
76 r: 0.95,
77 g: 0.25,
78 b: 0.55,
79 a: 1.0,
80 },
81 size: 5.0,
82 shape: MarkerShape::Circle,
83 }),
84 );
85
86 let baseline = Series::from_explicit_callback(
87 "baseline(callback)",
88 |x| (x * 0.015).sin() * 0.4,
89 Range::new(0.0, 25_000.0),
90 5_000,
91 SeriesKind::Line(LineStyle {
92 color: Rgba {
93 r: 0.45,
94 g: 0.45,
95 b: 0.5,
96 a: 0.8,
97 },
98 width: 1.0,
99 }),
100 );
101
102 let mut top_plot = Plot::builder()
103 .theme(Theme::dark())
104 .x_axis(AxisConfig::builder().title("Sample").build())
105 .y_axis(AxisConfig::builder().title("Top: stream + events").build())
106 .view(View::FollowLastN { points: 2_000 })
107 .build();
108 top_plot.add_series(&stream_a);
109 top_plot.add_series(&events);
110
111 let mut bottom_plot = Plot::builder()
112 .theme(Theme::dark())
113 .x_axis(AxisConfig::builder().title("Sample").build())
114 .y_axis(
115 AxisConfig::builder()
116 .title("Bottom: stream + baseline")
117 .build(),
118 )
119 .view(View::FollowLastNXY { points: 2_000 })
120 .build();
121 bottom_plot.add_series(&stream_b);
122 bottom_plot.add_series(&baseline);
123
124 let config = PlotViewConfig {
125 show_legend: true,
126 show_hover: true,
127 ..Default::default()
128 };
129
130 let link_group = PlotLinkGroup::new();
131 let options = PlotLinkOptions {
132 link_x: true,
133 link_y: false,
134 link_cursor: true,
135 link_brush: true,
136 link_reset: true,
137 };
138
139 let top = cx.new(|_| {
140 PlotView::with_config(top_plot, config.clone()).with_link_group(link_group.clone(), options)
141 });
142 let bottom =
143 cx.new(|_| PlotView::with_config(bottom_plot, config).with_link_group(link_group, options));
144
145 (top, bottom, stream_a, stream_b)
146}Sourcepub fn scatter(name: impl Into<String>) -> Self
pub fn scatter(name: impl Into<String>) -> Self
Create a scatter series with indexed data.
Indexed data uses implicit X values (0, 1, 2, …).
Sourcepub fn from_iter_y<I, T>(
name: impl Into<String>,
iter: I,
kind: SeriesKind,
) -> Self
pub fn from_iter_y<I, T>( name: impl Into<String>, iter: I, kind: SeriesKind, ) -> Self
Build a series from an iterator of Y values.
X values are assigned as implicit indices.
Examples found in repository?
7fn main() {
8 Application::new().run(|cx| {
9 let options = WindowOptions {
10 window_bounds: Some(WindowBounds::Windowed(Bounds::centered(
11 None,
12 size(px(720.0), px(480.0)),
13 cx,
14 ))),
15 ..Default::default()
16 };
17
18 cx.open_window(options, |_window, cx| {
19 let series = Series::from_iter_y(
20 "signal",
21 (0..400).map(|i| {
22 let x = i as f64 * 0.03;
23 x.sin()
24 }),
25 SeriesKind::Line(LineStyle {
26 color: Rgba {
27 r: 0.2,
28 g: 0.75,
29 b: 0.95,
30 a: 1.0,
31 },
32 width: 2.0,
33 }),
34 );
35
36 let mut plot = Plot::builder()
37 .theme(Theme::dark())
38 .x_axis(AxisConfig::builder().title("Sample").build())
39 .y_axis(AxisConfig::builder().title("Amplitude").build())
40 .build();
41 plot.add_series(&series);
42
43 let config = PlotViewConfig {
44 show_legend: true,
45 show_hover: true,
46 ..Default::default()
47 };
48
49 let view = PlotView::with_config(plot, config);
50 cx.new(|_| view)
51 })
52 .unwrap();
53 });
54}Sourcepub fn from_iter_points<I>(
name: impl Into<String>,
iter: I,
kind: SeriesKind,
) -> Selfwhere
I: IntoIterator<Item = Point>,
pub fn from_iter_points<I>(
name: impl Into<String>,
iter: I,
kind: SeriesKind,
) -> Selfwhere
I: IntoIterator<Item = Point>,
Build a series from an iterator of points.
X values are taken from each Point.
Examples found in repository?
34fn build_views(
35 cx: &mut gpui::App,
36) -> (
37 gpui::Entity<PlotView>,
38 gpui::Entity<PlotView>,
39 Series,
40 Series,
41) {
42 let mut stream_a = Series::line("stream-A").with_kind(SeriesKind::Line(LineStyle {
43 color: Rgba {
44 r: 0.2,
45 g: 0.82,
46 b: 0.95,
47 a: 1.0,
48 },
49 width: 2.0,
50 }));
51 let mut stream_b = Series::line("stream-B").with_kind(SeriesKind::Line(LineStyle {
52 color: Rgba {
53 r: 0.95,
54 g: 0.64,
55 b: 0.28,
56 a: 1.0,
57 },
58 width: 2.0,
59 }));
60
61 for i in 0..1_000 {
62 let phase = i as f64 * 0.02;
63 let _ = stream_a.push_y((phase * 0.9).sin() + 0.2 * (phase * 0.13).cos());
64 let _ = stream_b.push_y((phase * 0.45).cos() * 1.15 + 0.15 * (phase * 0.09).sin());
65 }
66
67 let events = Series::from_iter_points(
68 "events(scatter)",
69 (0..200).map(|i| {
70 let x = i as f64 * 80.0 + 40.0;
71 let y = (x * 0.02).sin() * 0.9;
72 gpui_liveplot::Point::new(x, y)
73 }),
74 SeriesKind::Scatter(MarkerStyle {
75 color: Rgba {
76 r: 0.95,
77 g: 0.25,
78 b: 0.55,
79 a: 1.0,
80 },
81 size: 5.0,
82 shape: MarkerShape::Circle,
83 }),
84 );
85
86 let baseline = Series::from_explicit_callback(
87 "baseline(callback)",
88 |x| (x * 0.015).sin() * 0.4,
89 Range::new(0.0, 25_000.0),
90 5_000,
91 SeriesKind::Line(LineStyle {
92 color: Rgba {
93 r: 0.45,
94 g: 0.45,
95 b: 0.5,
96 a: 0.8,
97 },
98 width: 1.0,
99 }),
100 );
101
102 let mut top_plot = Plot::builder()
103 .theme(Theme::dark())
104 .x_axis(AxisConfig::builder().title("Sample").build())
105 .y_axis(AxisConfig::builder().title("Top: stream + events").build())
106 .view(View::FollowLastN { points: 2_000 })
107 .build();
108 top_plot.add_series(&stream_a);
109 top_plot.add_series(&events);
110
111 let mut bottom_plot = Plot::builder()
112 .theme(Theme::dark())
113 .x_axis(AxisConfig::builder().title("Sample").build())
114 .y_axis(
115 AxisConfig::builder()
116 .title("Bottom: stream + baseline")
117 .build(),
118 )
119 .view(View::FollowLastNXY { points: 2_000 })
120 .build();
121 bottom_plot.add_series(&stream_b);
122 bottom_plot.add_series(&baseline);
123
124 let config = PlotViewConfig {
125 show_legend: true,
126 show_hover: true,
127 ..Default::default()
128 };
129
130 let link_group = PlotLinkGroup::new();
131 let options = PlotLinkOptions {
132 link_x: true,
133 link_y: false,
134 link_cursor: true,
135 link_brush: true,
136 link_reset: true,
137 };
138
139 let top = cx.new(|_| {
140 PlotView::with_config(top_plot, config.clone()).with_link_group(link_group.clone(), options)
141 });
142 let bottom =
143 cx.new(|_| PlotView::with_config(bottom_plot, config).with_link_group(link_group, options));
144
145 (top, bottom, stream_a, stream_b)
146}Sourcepub fn from_explicit_callback(
name: impl Into<String>,
function: impl Fn(f64) -> f64,
x_range: Range,
points: usize,
kind: SeriesKind,
) -> Self
pub fn from_explicit_callback( name: impl Into<String>, function: impl Fn(f64) -> f64, x_range: Range, points: usize, kind: SeriesKind, ) -> Self
Build a series by sampling a callback function.
The callback is sampled uniformly across x_range.
Examples found in repository?
34fn build_views(
35 cx: &mut gpui::App,
36) -> (
37 gpui::Entity<PlotView>,
38 gpui::Entity<PlotView>,
39 Series,
40 Series,
41) {
42 let mut stream_a = Series::line("stream-A").with_kind(SeriesKind::Line(LineStyle {
43 color: Rgba {
44 r: 0.2,
45 g: 0.82,
46 b: 0.95,
47 a: 1.0,
48 },
49 width: 2.0,
50 }));
51 let mut stream_b = Series::line("stream-B").with_kind(SeriesKind::Line(LineStyle {
52 color: Rgba {
53 r: 0.95,
54 g: 0.64,
55 b: 0.28,
56 a: 1.0,
57 },
58 width: 2.0,
59 }));
60
61 for i in 0..1_000 {
62 let phase = i as f64 * 0.02;
63 let _ = stream_a.push_y((phase * 0.9).sin() + 0.2 * (phase * 0.13).cos());
64 let _ = stream_b.push_y((phase * 0.45).cos() * 1.15 + 0.15 * (phase * 0.09).sin());
65 }
66
67 let events = Series::from_iter_points(
68 "events(scatter)",
69 (0..200).map(|i| {
70 let x = i as f64 * 80.0 + 40.0;
71 let y = (x * 0.02).sin() * 0.9;
72 gpui_liveplot::Point::new(x, y)
73 }),
74 SeriesKind::Scatter(MarkerStyle {
75 color: Rgba {
76 r: 0.95,
77 g: 0.25,
78 b: 0.55,
79 a: 1.0,
80 },
81 size: 5.0,
82 shape: MarkerShape::Circle,
83 }),
84 );
85
86 let baseline = Series::from_explicit_callback(
87 "baseline(callback)",
88 |x| (x * 0.015).sin() * 0.4,
89 Range::new(0.0, 25_000.0),
90 5_000,
91 SeriesKind::Line(LineStyle {
92 color: Rgba {
93 r: 0.45,
94 g: 0.45,
95 b: 0.5,
96 a: 0.8,
97 },
98 width: 1.0,
99 }),
100 );
101
102 let mut top_plot = Plot::builder()
103 .theme(Theme::dark())
104 .x_axis(AxisConfig::builder().title("Sample").build())
105 .y_axis(AxisConfig::builder().title("Top: stream + events").build())
106 .view(View::FollowLastN { points: 2_000 })
107 .build();
108 top_plot.add_series(&stream_a);
109 top_plot.add_series(&events);
110
111 let mut bottom_plot = Plot::builder()
112 .theme(Theme::dark())
113 .x_axis(AxisConfig::builder().title("Sample").build())
114 .y_axis(
115 AxisConfig::builder()
116 .title("Bottom: stream + baseline")
117 .build(),
118 )
119 .view(View::FollowLastNXY { points: 2_000 })
120 .build();
121 bottom_plot.add_series(&stream_b);
122 bottom_plot.add_series(&baseline);
123
124 let config = PlotViewConfig {
125 show_legend: true,
126 show_hover: true,
127 ..Default::default()
128 };
129
130 let link_group = PlotLinkGroup::new();
131 let options = PlotLinkOptions {
132 link_x: true,
133 link_y: false,
134 link_cursor: true,
135 link_brush: true,
136 link_reset: true,
137 };
138
139 let top = cx.new(|_| {
140 PlotView::with_config(top_plot, config.clone()).with_link_group(link_group.clone(), options)
141 });
142 let bottom =
143 cx.new(|_| PlotView::with_config(bottom_plot, config).with_link_group(link_group, options));
144
145 (top, bottom, stream_a, stream_b)
146}Sourcepub fn kind(&self) -> &SeriesKind
pub fn kind(&self) -> &SeriesKind
Access the series kind.
Sourcepub fn with_kind(self, kind: SeriesKind) -> Self
pub fn with_kind(self, kind: SeriesKind) -> Self
Replace the series kind.
Examples found in repository?
34fn build_views(
35 cx: &mut gpui::App,
36) -> (
37 gpui::Entity<PlotView>,
38 gpui::Entity<PlotView>,
39 Series,
40 Series,
41) {
42 let mut stream_a = Series::line("stream-A").with_kind(SeriesKind::Line(LineStyle {
43 color: Rgba {
44 r: 0.2,
45 g: 0.82,
46 b: 0.95,
47 a: 1.0,
48 },
49 width: 2.0,
50 }));
51 let mut stream_b = Series::line("stream-B").with_kind(SeriesKind::Line(LineStyle {
52 color: Rgba {
53 r: 0.95,
54 g: 0.64,
55 b: 0.28,
56 a: 1.0,
57 },
58 width: 2.0,
59 }));
60
61 for i in 0..1_000 {
62 let phase = i as f64 * 0.02;
63 let _ = stream_a.push_y((phase * 0.9).sin() + 0.2 * (phase * 0.13).cos());
64 let _ = stream_b.push_y((phase * 0.45).cos() * 1.15 + 0.15 * (phase * 0.09).sin());
65 }
66
67 let events = Series::from_iter_points(
68 "events(scatter)",
69 (0..200).map(|i| {
70 let x = i as f64 * 80.0 + 40.0;
71 let y = (x * 0.02).sin() * 0.9;
72 gpui_liveplot::Point::new(x, y)
73 }),
74 SeriesKind::Scatter(MarkerStyle {
75 color: Rgba {
76 r: 0.95,
77 g: 0.25,
78 b: 0.55,
79 a: 1.0,
80 },
81 size: 5.0,
82 shape: MarkerShape::Circle,
83 }),
84 );
85
86 let baseline = Series::from_explicit_callback(
87 "baseline(callback)",
88 |x| (x * 0.015).sin() * 0.4,
89 Range::new(0.0, 25_000.0),
90 5_000,
91 SeriesKind::Line(LineStyle {
92 color: Rgba {
93 r: 0.45,
94 g: 0.45,
95 b: 0.5,
96 a: 0.8,
97 },
98 width: 1.0,
99 }),
100 );
101
102 let mut top_plot = Plot::builder()
103 .theme(Theme::dark())
104 .x_axis(AxisConfig::builder().title("Sample").build())
105 .y_axis(AxisConfig::builder().title("Top: stream + events").build())
106 .view(View::FollowLastN { points: 2_000 })
107 .build();
108 top_plot.add_series(&stream_a);
109 top_plot.add_series(&events);
110
111 let mut bottom_plot = Plot::builder()
112 .theme(Theme::dark())
113 .x_axis(AxisConfig::builder().title("Sample").build())
114 .y_axis(
115 AxisConfig::builder()
116 .title("Bottom: stream + baseline")
117 .build(),
118 )
119 .view(View::FollowLastNXY { points: 2_000 })
120 .build();
121 bottom_plot.add_series(&stream_b);
122 bottom_plot.add_series(&baseline);
123
124 let config = PlotViewConfig {
125 show_legend: true,
126 show_hover: true,
127 ..Default::default()
128 };
129
130 let link_group = PlotLinkGroup::new();
131 let options = PlotLinkOptions {
132 link_x: true,
133 link_y: false,
134 link_cursor: true,
135 link_brush: true,
136 link_reset: true,
137 };
138
139 let top = cx.new(|_| {
140 PlotView::with_config(top_plot, config.clone()).with_link_group(link_group.clone(), options)
141 });
142 let bottom =
143 cx.new(|_| PlotView::with_config(bottom_plot, config).with_link_group(link_group, options));
144
145 (top, bottom, stream_a, stream_b)
146}Create another series handle that shares the same append-only data.
The returned series receives a new SeriesId, so it can coexist with
the source series in the same plot. Data appends through either series
are immediately visible to all shared handles.
Sourcepub fn push_y(&mut self, y: f64) -> Result<usize, AppendError>
pub fn push_y(&mut self, y: f64) -> Result<usize, AppendError>
Append a Y value to an indexed series.
Examples found in repository?
34fn build_views(
35 cx: &mut gpui::App,
36) -> (
37 gpui::Entity<PlotView>,
38 gpui::Entity<PlotView>,
39 Series,
40 Series,
41) {
42 let mut stream_a = Series::line("stream-A").with_kind(SeriesKind::Line(LineStyle {
43 color: Rgba {
44 r: 0.2,
45 g: 0.82,
46 b: 0.95,
47 a: 1.0,
48 },
49 width: 2.0,
50 }));
51 let mut stream_b = Series::line("stream-B").with_kind(SeriesKind::Line(LineStyle {
52 color: Rgba {
53 r: 0.95,
54 g: 0.64,
55 b: 0.28,
56 a: 1.0,
57 },
58 width: 2.0,
59 }));
60
61 for i in 0..1_000 {
62 let phase = i as f64 * 0.02;
63 let _ = stream_a.push_y((phase * 0.9).sin() + 0.2 * (phase * 0.13).cos());
64 let _ = stream_b.push_y((phase * 0.45).cos() * 1.15 + 0.15 * (phase * 0.09).sin());
65 }
66
67 let events = Series::from_iter_points(
68 "events(scatter)",
69 (0..200).map(|i| {
70 let x = i as f64 * 80.0 + 40.0;
71 let y = (x * 0.02).sin() * 0.9;
72 gpui_liveplot::Point::new(x, y)
73 }),
74 SeriesKind::Scatter(MarkerStyle {
75 color: Rgba {
76 r: 0.95,
77 g: 0.25,
78 b: 0.55,
79 a: 1.0,
80 },
81 size: 5.0,
82 shape: MarkerShape::Circle,
83 }),
84 );
85
86 let baseline = Series::from_explicit_callback(
87 "baseline(callback)",
88 |x| (x * 0.015).sin() * 0.4,
89 Range::new(0.0, 25_000.0),
90 5_000,
91 SeriesKind::Line(LineStyle {
92 color: Rgba {
93 r: 0.45,
94 g: 0.45,
95 b: 0.5,
96 a: 0.8,
97 },
98 width: 1.0,
99 }),
100 );
101
102 let mut top_plot = Plot::builder()
103 .theme(Theme::dark())
104 .x_axis(AxisConfig::builder().title("Sample").build())
105 .y_axis(AxisConfig::builder().title("Top: stream + events").build())
106 .view(View::FollowLastN { points: 2_000 })
107 .build();
108 top_plot.add_series(&stream_a);
109 top_plot.add_series(&events);
110
111 let mut bottom_plot = Plot::builder()
112 .theme(Theme::dark())
113 .x_axis(AxisConfig::builder().title("Sample").build())
114 .y_axis(
115 AxisConfig::builder()
116 .title("Bottom: stream + baseline")
117 .build(),
118 )
119 .view(View::FollowLastNXY { points: 2_000 })
120 .build();
121 bottom_plot.add_series(&stream_b);
122 bottom_plot.add_series(&baseline);
123
124 let config = PlotViewConfig {
125 show_legend: true,
126 show_hover: true,
127 ..Default::default()
128 };
129
130 let link_group = PlotLinkGroup::new();
131 let options = PlotLinkOptions {
132 link_x: true,
133 link_y: false,
134 link_cursor: true,
135 link_brush: true,
136 link_reset: true,
137 };
138
139 let top = cx.new(|_| {
140 PlotView::with_config(top_plot, config.clone()).with_link_group(link_group.clone(), options)
141 });
142 let bottom =
143 cx.new(|_| PlotView::with_config(bottom_plot, config).with_link_group(link_group, options));
144
145 (top, bottom, stream_a, stream_b)
146}Sourcepub fn extend_y<I, T>(&mut self, values: I) -> Result<usize, AppendError>
pub fn extend_y<I, T>(&mut self, values: I) -> Result<usize, AppendError>
Append multiple Y values to an indexed series.
Returns the number of appended points.
Examples found in repository?
148fn spawn_updates(
149 window: &mut gpui::Window,
150 cx: &mut gpui::App,
151 top: gpui::Entity<PlotView>,
152 bottom: gpui::Entity<PlotView>,
153 mut stream_a: Series,
154 mut stream_b: Series,
155) {
156 window
157 .spawn(cx, move |cx: &mut AsyncWindowContext| {
158 let mut cx = cx.clone();
159 async move {
160 let mut phase = 0.0_f64;
161 loop {
162 Timer::after(Duration::from_millis(16)).await;
163 let _ = stream_a.extend_y((0..120).map(|_| {
164 let y = (phase * 0.9).sin() + 0.2 * (phase * 0.13).cos();
165 phase += 0.02;
166 y
167 }));
168 let _ = stream_b.extend_y((0..120).map(|_| {
169 let y = (phase * 0.45).cos() * 1.15 + 0.15 * (phase * 0.09).sin();
170 phase += 0.02;
171 y
172 }));
173
174 let _ = cx.update(|_, cx| {
175 top.update(cx, |_view, view_cx| view_cx.notify());
176 bottom.update(cx, |_view, view_cx| view_cx.notify());
177 });
178 }
179 }
180 })
181 .detach();
182}Sourcepub fn push_point(&mut self, point: Point) -> Result<usize, AppendError>
pub fn push_point(&mut self, point: Point) -> Result<usize, AppendError>
Append a point to an explicit series.
Sourcepub fn extend_points<I>(&mut self, points: I) -> Result<usize, AppendError>where
I: IntoIterator<Item = Point>,
pub fn extend_points<I>(&mut self, points: I) -> Result<usize, AppendError>where
I: IntoIterator<Item = Point>,
Append multiple explicit points to a series.
Returns the number of appended points when X values stay monotonic.
If any new point has a smaller X than the previous point, all points are
still appended and AppendError::NonMonotonicX is returned.
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
Access the series generation.
This monotonically increasing value is used for render cache invalidation.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Check if the series is visible.
Sourcepub fn set_visible(&mut self, visible: bool)
pub fn set_visible(&mut self, visible: bool)
Toggle series visibility.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Series
impl RefUnwindSafe for Series
impl Send for Series
impl Sync for Series
impl Unpin for Series
impl UnsafeUnpin for Series
impl UnwindSafe for Series
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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)
&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)
&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>
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>
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