Skip to main content

PlotUi

Struct PlotUi 

Source
pub struct PlotUi<'ui> { /* private fields */ }
Expand description

A temporary reference for building plots

This struct ensures that plots can only be created when both ImGui and ImPlot contexts are available and properly set up.

Implementations§

Source§

impl<'ui> PlotUi<'ui>

Source

pub fn setup_x_axis(&self, axis: XAxis, label: Option<&str>, flags: AxisFlags)

Setup a specific X axis

Source

pub fn setup_y_axis(&self, axis: YAxis, label: Option<&str>, flags: AxisFlags)

Setup a specific Y axis

Source

pub fn setup_x_axis_limits( &self, axis: XAxis, min: f64, max: f64, cond: PlotCond, )

Setup axis limits for a specific X axis

Source

pub fn setup_y_axis_limits( &self, axis: YAxis, min: f64, max: f64, cond: PlotCond, )

Setup axis limits for a specific Y axis

Link an axis to external min/max values (live binding)

Link a raw axis to external min/max values (live binding).

§Safety

axis must be a valid ImPlot ImAxis value for the active plot. Passing an out-of-range value lets ImPlot index internal axis arrays out of bounds.

Source

pub fn setup_axes( &self, x_label: Option<&str>, y_label: Option<&str>, x_flags: AxisFlags, y_flags: AxisFlags, )

Setup both axes labels/flags at once

Source

pub fn setup_axes_limits( &self, x_min: f64, x_max: f64, y_min: f64, y_max: f64, cond: PlotCond, )

Setup axes limits (both) at once

Source

pub fn setup_finish(&self)

Call after axis setup to finalize configuration

Source

pub fn set_next_x_axis_limits( &self, axis: XAxis, min: f64, max: f64, cond: PlotCond, )

Set next frame limits for a specific axis

Source

pub fn set_next_y_axis_limits( &self, axis: YAxis, min: f64, max: f64, cond: PlotCond, )

Set next frame limits for a specific axis

Link an axis to external min/max for next frame

Link a raw axis to external min/max for the next frame.

§Safety

axis must be a valid ImPlot ImAxis value. Passing an out-of-range value lets ImPlot index internal next-plot arrays out of bounds.

Source

pub fn set_next_axes_limits( &self, x_min: f64, x_max: f64, y_min: f64, y_max: f64, cond: PlotCond, )

Set next frame limits for both axes

Source

pub fn set_next_axes_to_fit(&self)

Fit next frame both axes

Source

pub fn set_next_axis_to_fit(&self, axis: Axis)

Fit next frame a specific axis

Source

pub unsafe fn set_next_axis_to_fit_unchecked(&self, axis: ImAxis)

Fit next frame a raw axis.

§Safety

axis must be a valid ImPlot ImAxis value. Passing an out-of-range value lets ImPlot index internal next-plot arrays out of bounds.

Source

pub fn set_next_x_axis_to_fit(&self, axis: XAxis)

Fit next frame a specific X axis

Source

pub fn set_next_y_axis_to_fit(&self, axis: YAxis)

Fit next frame a specific Y axis

Source

pub fn setup_x_axis_ticks_positions( &self, axis: XAxis, values: &[f64], labels: Option<&[&str]>, keep_default: bool, )

Setup ticks with explicit positions and optional labels for an X axis.

If labels is provided, it must have the same length as values.

Source

pub fn setup_y_axis_ticks_positions( &self, axis: YAxis, values: &[f64], labels: Option<&[&str]>, keep_default: bool, )

Setup ticks with explicit positions and optional labels for a Y axis.

If labels is provided, it must have the same length as values.

Source

pub fn setup_x_axis_ticks_range( &self, axis: XAxis, v_min: f64, v_max: f64, n_ticks: usize, labels: Option<&[&str]>, keep_default: bool, )

Setup ticks on a range with tick count and optional labels for an X axis.

If labels is provided, it must have length n_ticks.

Source

pub fn setup_y_axis_ticks_range( &self, axis: YAxis, v_min: f64, v_max: f64, n_ticks: usize, labels: Option<&[&str]>, keep_default: bool, )

Setup ticks on a range with tick count and optional labels for a Y axis.

If labels is provided, it must have length n_ticks.

Source

pub fn setup_x_axis_format(&self, axis: XAxis, format: &AxisFormat<'_>)

Setup a validated tick label format for a specific X axis.

Source

pub fn setup_y_axis_format(&self, axis: YAxis, format: &AxisFormat<'_>)

Setup a validated tick label format for a specific Y axis.

Source

pub fn setup_x_axis_scale(&self, axis: XAxis, scale: ImPlotScale)

Setup scale for a specific X axis (pass sys::ImPlotScale variant)

Source

pub fn setup_y_axis_scale(&self, axis: YAxis, scale: ImPlotScale)

Setup scale for a specific Y axis (pass sys::ImPlotScale variant)

Source

pub fn setup_axis_limits_constraints(&self, axis: Axis, v_min: f64, v_max: f64)

Setup axis limits constraints

Source

pub unsafe fn setup_axis_limits_constraints_unchecked( &self, axis: ImAxis, v_min: f64, v_max: f64, )

Setup raw axis limits constraints.

§Safety

axis must be a valid ImPlot ImAxis value for the active plot. Passing an out-of-range value lets ImPlot index internal axis arrays out of bounds.

Source

pub fn setup_axis_zoom_constraints(&self, axis: Axis, z_min: f64, z_max: f64)

Setup axis zoom constraints

Source

pub unsafe fn setup_axis_zoom_constraints_unchecked( &self, axis: ImAxis, z_min: f64, z_max: f64, )

Setup raw axis zoom constraints.

§Safety

axis must be a valid ImPlot ImAxis value for the active plot. Passing an out-of-range value lets ImPlot index internal axis arrays out of bounds.

Source§

impl<'ui> PlotUi<'ui>

Source

pub fn setup_x_axis_format_closure<F>( &self, axis: XAxis, f: F, ) -> AxisFormatterToken
where F: Fn(f64) -> String + Send + Sync + 'static,

Setup tick label formatter using a Rust closure.

The closure is kept alive until the current plot ends.

Source

pub fn setup_y_axis_format_closure<F>( &self, axis: YAxis, f: F, ) -> AxisFormatterToken
where F: Fn(f64) -> String + Send + Sync + 'static,

Setup tick label formatter using a Rust closure.

The closure is kept alive until the current plot ends.

Source

pub fn setup_x_axis_transform_closure<FW, INV>( &self, axis: XAxis, forward: FW, inverse: INV, ) -> AxisTransformToken
where FW: Fn(f64) -> f64 + Send + Sync + 'static, INV: Fn(f64) -> f64 + Send + Sync + 'static,

Setup custom axis transform using Rust closures (forward/inverse).

The closures are kept alive until the current plot ends.

Source

pub fn setup_y_axis_transform_closure<FW, INV>( &self, axis: YAxis, forward: FW, inverse: INV, ) -> AxisTransformToken
where FW: Fn(f64) -> f64 + Send + Sync + 'static, INV: Fn(f64) -> f64 + Send + Sync + 'static,

Setup custom axis transform for Y axis using closures

Source§

impl<'ui> PlotUi<'ui>

Source

pub fn begin_plot(&self, title: &str) -> Option<PlotToken<'_>>

Begin a new plot with the given title

Returns a PlotToken if the plot was successfully started. The plot will be automatically ended when the token is dropped.

Source

pub fn begin_plot_with_size( &self, title: &str, size: [f32; 2], ) -> Option<PlotToken<'_>>

Begin a plot with custom size

Source

pub fn plot_line(&self, label: &str, x_data: &[f64], y_data: &[f64])

Plot a line with the given label and data

This is a convenience method that can be called within a plot.

Source

pub fn plot_scatter(&self, label: &str, x_data: &[f64], y_data: &[f64])

Plot a scatter plot with the given label and data

Source

pub fn plot_polygon(&self, label: &str, x_data: &[f64], y_data: &[f64])

Plot a polygon with the given label and vertex data.

Source

pub fn is_plot_hovered(&self) -> bool

Check if the plot area is hovered

Source

pub fn get_plot_mouse_pos(&self, y_axis: Option<YAxisChoice>) -> ImPlotPoint

Get the mouse position in plot coordinates

Source

pub fn get_plot_mouse_pos_axes( &self, x_axis: XAxis, y_axis: YAxis, ) -> ImPlotPoint

Get the mouse position in plot coordinates for specific axes

Source

pub fn set_axes(&self, x_axis: XAxis, y_axis: YAxis)

Set current axes for subsequent plot submissions

Source§

impl<'ui> PlotUi<'ui>

Source

pub unsafe fn with_next_plot_item_array_style<'a, R>( &self, style: PlotItemArrayStyle<'a>, f: impl FnOnce(&PlotUi<'ui>) -> R, ) -> R

Apply array-backed item styling to the next plot submission executed inside f.

This is closure-scoped so borrowed slices stay valid for the entire next plot call and are restored even if f panics before submitting an item.

§Safety

Every non-empty style array must contain enough elements for every index the submitted plot may read. Upstream accepts only pointers and carries no array lengths, so this cannot be validated by the wrapper.

Source

pub fn push_style_var_f32(&self, var: StyleVar, value: f32) -> StyleVarToken<'_>

Push a float style variable to this ImPlot context’s stack.

Source

pub fn push_style_var_vec2( &self, var: StyleVar, value: [f32; 2], ) -> StyleVarToken<'_>

Push a Vec2 style variable to this ImPlot context’s stack.

Source

pub fn push_style_color( &self, element: PlotColorElement, color: [f32; 4], ) -> StyleColorToken<'_>

Push a style color to this ImPlot context’s stack.

Source

pub fn push_colormap(&self, cmap: impl Into<ColormapIndex>) -> ColormapToken<'_>

Push a colormap to this ImPlot context’s stack.

Source

pub fn push_colormap_name(&self, name: &str) -> ColormapToken<'_>

Push a colormap by name to this ImPlot context’s stack.

Source§

impl PlotUi<'_>

Source

pub fn show_style_editor(&self)

Show the ImPlot style editor window for this context.

Source

pub fn show_style_selector(&self, label: &str) -> bool

Show the ImPlot style selector combo; returns true if selection changed.

Source

pub fn show_colormap_selector(&self, label: &str) -> bool

Show the ImPlot colormap selector combo; returns true if selection changed.

Source

pub fn show_input_map_selector(&self, label: &str) -> bool

Show the ImPlot input-map selector combo; returns true if selection changed.

Source

pub fn colormap_scale( &self, label: &str, scale_min: f64, scale_max: f64, height: f32, cmap: impl Into<ColormapSelection>, )

Draw a colormap scale widget.

Source

pub fn colormap_scale_with_format( &self, label: &str, scale_min: f64, scale_max: f64, height: f32, format: &FloatFormat<'_>, cmap: impl Into<ColormapSelection>, )

Draw a colormap scale with a validated tick format.

Source

pub fn colormap_slider( &self, label: &str, t: &mut f32, out_color: Option<&mut [f32; 4]>, cmap: impl Into<ColormapSelection>, ) -> bool

Draw a colormap slider with ImPlot’s default value format.

Source

pub fn colormap_slider_with_format( &self, label: &str, t: &mut f32, out_color: Option<&mut [f32; 4]>, format: &FloatFormat<'_>, cmap: impl Into<ColormapSelection>, ) -> bool

Draw a colormap slider with a validated value format.

Source

pub fn colormap_button( &self, label: &str, size: [f32; 2], cmap: impl Into<ColormapSelection>, ) -> bool

Draw a colormap picker button; returns true if clicked.

Source§

impl PlotUi<'_>

Source

pub fn is_subplots_hovered(&self) -> bool

Check if any subplots area is hovered.

Source

pub fn is_legend_entry_hovered(&self, label: &str) -> bool

Check if a legend entry is hovered.

Source

pub fn plot_mouse_position( &self, y_axis_choice: Option<YAxisChoice>, ) -> ImPlotPoint

Get the mouse position in plot coordinates.

Source

pub fn plot_mouse_position_axes( &self, x_axis: XAxis, y_axis: YAxis, ) -> ImPlotPoint

Get the mouse position in plot coordinates for specific axes.

Source

pub fn pixels_to_plot( &self, pixel_position: [f32; 2], y_axis_choice: Option<YAxisChoice>, ) -> ImPlotPoint

Convert pixels to plot coordinates.

Source

pub fn pixels_to_plot_axes( &self, pixel_position: [f32; 2], x_axis: XAxis, y_axis: YAxis, ) -> ImPlotPoint

Convert pixels to plot coordinates for specific axes.

Source

pub fn plot_to_pixels( &self, plot_position: ImPlotPoint, y_axis_choice: Option<YAxisChoice>, ) -> [f32; 2]

Convert plot coordinates to pixels.

Source

pub fn plot_to_pixels_axes( &self, plot_position: ImPlotPoint, x_axis: XAxis, y_axis: YAxis, ) -> [f32; 2]

Convert plot coordinates to pixels for specific axes.

Source

pub fn plot_limits( &self, _x_axis_choice: Option<YAxisChoice>, y_axis_choice: Option<YAxisChoice>, ) -> ImPlotRect

Get the current plot limits.

Source

pub fn is_plot_selected(&self) -> bool

Whether a plot has an active selection region.

Source

pub fn plot_selection_axes( &self, x_axis: XAxis, y_axis: YAxis, ) -> Option<ImPlotRect>

Get the current plot selection rectangle for specific axes.

Source

pub fn annotation_point( &self, x: f64, y: f64, color: [f32; 4], pixel_offset: [f32; 2], clamp: bool, round: bool, )

Draw a simple round annotation marker at (x,y).

Source

pub fn annotation_text( &self, x: f64, y: f64, color: [f32; 4], pixel_offset: [f32; 2], clamp: bool, text: &str, )

Draw a literal text annotation at (x,y).

The underlying non-variadic C entrypoint still accepts a printf format string, so percent signs are escaped before crossing the FFI boundary.

Source

pub fn tag_x(&self, x: f64, color: [f32; 4], round: bool)

Tag the X axis at position x with a tick-like mark.

Source

pub fn tag_x_text(&self, x: f64, color: [f32; 4], text: &str)

Tag the X axis at position x with a literal text label.

Source

pub fn tag_y(&self, y: f64, color: [f32; 4], round: bool)

Tag the Y axis at position y with a tick-like mark.

Source

pub fn tag_y_text(&self, y: f64, color: [f32; 4], text: &str)

Tag the Y axis at position y with a literal text label.

Source

pub fn plot_limits_axes(&self, x_axis: XAxis, y_axis: YAxis) -> ImPlotRect

Get the current plot limits for specific axes.

Source

pub fn is_axis_hovered(&self, axis: Axis) -> bool

Check if an axis is hovered.

Source

pub unsafe fn is_axis_hovered_unchecked(&self, axis: ImAxis) -> bool

Check if a raw axis is hovered.

§Safety

axis must be a valid ImPlot ImAxis value for the current plot. Passing an out-of-range value lets ImPlot index internal axis arrays out of bounds.

Source

pub fn is_plot_x_axis_hovered(&self) -> bool

Check if the X axis is hovered.

Source

pub fn is_plot_x_axis_hovered_axis(&self, x_axis: XAxis) -> bool

Check if a specific X axis is hovered.

Source

pub fn is_plot_y_axis_hovered(&self, y_axis_choice: Option<YAxisChoice>) -> bool

Check if a Y axis is hovered.

Source

pub fn is_plot_y_axis_hovered_axis(&self, y_axis: YAxis) -> bool

Check if a specific Y axis is hovered.

Source

pub fn show_demo_window(&self, _show: &mut bool)

Stub when demo feature is disabled.

Source

pub fn show_user_guide(&self)

Show the built-in user guide for ImPlot.

Source

pub fn show_metrics_window(&self, open: &mut bool)

Show the metrics window.

Source

pub fn plot_pos(&self) -> [f32; 2]

Get current plot position (top-left) in pixels.

Source

pub fn plot_size(&self) -> [f32; 2]

Get current plot size in pixels.

Source§

impl PlotUi<'_>

Source

pub fn drag_point( &self, id: DragToolId, x: &mut f64, y: &mut f64, color: [f32; 4], size: f32, flags: DragToolFlags, ) -> DragResult

Draggable point with result flags.

Source

pub fn drag_line_x( &self, id: DragToolId, x: &mut f64, color: [f32; 4], thickness: f32, flags: DragToolFlags, ) -> DragResult

Draggable vertical line at x.

Source

pub fn drag_line_y( &self, id: DragToolId, y: &mut f64, color: [f32; 4], thickness: f32, flags: DragToolFlags, ) -> DragResult

Draggable horizontal line at y.

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick bar plotting

Source

pub fn bar_plot(&self, label: &str, values: &[f64]) -> Result<(), PlotError>

Plot a bar chart with values (X will be indices)

Source

pub fn bar_plot_with_width( &self, label: &str, values: &[f64], width: f64, ) -> Result<(), PlotError>

Plot a bar chart with custom bar width

Source

pub fn positional_bar_plot( &self, label: &str, x_data: &[f64], y_data: &[f64], ) -> Result<(), PlotError>

Plot a positional bar chart with explicit X and Y data

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick error bars plotting

Source

pub fn error_bars_plot( &self, label: &str, x_data: &[f64], y_data: &[f64], err_data: &[f64], ) -> Result<(), PlotError>

Plot error bars with symmetric errors

Source

pub fn asymmetric_error_bars_plot( &self, label: &str, x_data: &[f64], y_data: &[f64], err_neg: &[f64], err_pos: &[f64], ) -> Result<(), PlotError>

Plot error bars with asymmetric errors

Source

pub fn simple_error_bars_plot( &self, label: &str, values: &[f64], errors: &[f64], ) -> Result<(), PlotError>

Plot simple error bars with Y values only (X will be indices)

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick heatmap plotting

Source

pub fn heatmap_plot( &self, label: &str, values: &[f64], rows: usize, cols: usize, ) -> Result<(), PlotError>

Plot a heatmap with f64 data

Source

pub fn heatmap_plot_f32( &self, label: &str, values: &[f32], rows: usize, cols: usize, ) -> Result<(), PlotError>

Plot a heatmap with f32 data

Source

pub fn heatmap_plot_scaled( &self, label: &str, values: &[f64], rows: usize, cols: usize, scale_min: f64, scale_max: f64, bounds_min: ImPlotPoint, bounds_max: ImPlotPoint, ) -> Result<(), PlotError>

Plot a heatmap with custom scale and bounds

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick histogram plotting

Source

pub fn histogram_plot( &self, label: &str, values: &[f64], ) -> Result<(), PlotError>

Plot a 1D histogram with default settings

Source

pub fn histogram_plot_with_bins( &self, label: &str, values: &[f64], bins: impl Into<HistogramBins>, ) -> Result<(), PlotError>

Plot a 1D histogram with custom bin count

Source

pub fn histogram_2d_plot( &self, label: &str, x_values: &[f64], y_values: &[f64], ) -> Result<(), PlotError>

Plot a 2D histogram (bivariate histogram as heatmap)

Source

pub fn histogram_2d_plot_with_bins( &self, label: &str, x_values: &[f64], y_values: &[f64], x_bins: impl Into<HistogramBins>, y_bins: impl Into<HistogramBins>, ) -> Result<(), PlotError>

Plot a 2D histogram with custom bin counts

Source§

impl<'ui> PlotUi<'ui>

Convenience methods on PlotUi

Source

pub fn plot_image<'tex>( &self, label: &str, texture: impl Into<TextureRef<'tex>>, bounds_min: ImPlotPoint, bounds_max: ImPlotPoint, ) -> Result<(), PlotError>

Source

pub fn plot_image_with_imgui_texture( &self, label: &str, texture: TextureId, bounds_min: ImPlotPoint, bounds_max: ImPlotPoint, ) -> Result<(), PlotError>

Plot an image using ImGui’s TextureId wrapper (if available)

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick inf-lines plotting

Source

pub fn inf_lines_vertical( &self, label: &str, xs: &[f64], ) -> Result<(), PlotError>

Plot vertical infinite lines at given x positions

Source

pub fn inf_lines_horizontal( &self, label: &str, ys: &[f64], ) -> Result<(), PlotError>

Plot horizontal infinite lines at given y positions

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick line plotting

Source

pub fn line_plot( &self, label: &str, x_data: &[f64], y_data: &[f64], ) -> Result<(), PlotError>

Plot a line with X and Y data

Source

pub fn simple_line_plot( &self, label: &str, values: &[f64], ) -> Result<(), PlotError>

Plot a simple line with Y values only (X will be indices)

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick pie chart plotting

Source

pub fn pie_chart_plot( &self, label_ids: Vec<&str>, values: &[f64], center_x: f64, center_y: f64, radius: f64, ) -> Result<(), PlotError>

Plot a pie chart with f64 data

Source

pub fn pie_chart_plot_f32( &self, label_ids: Vec<&str>, values: &[f32], center_x: f64, center_y: f64, radius: f64, ) -> Result<(), PlotError>

Plot a pie chart with f32 data

Source

pub fn centered_pie_chart( &self, label_ids: Vec<&str>, values: &[f64], ) -> Result<(), PlotError>

Plot a centered pie chart (center at 0.5, 0.5 with radius 0.4)

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick polygon plotting.

Source

pub fn polygon_plot( &self, label: &str, x_data: &[f64], y_data: &[f64], ) -> Result<(), PlotError>

Plot a polygon with X and Y vertex data.

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick scatter plotting

Source

pub fn scatter_plot( &self, label: &str, x_data: &[f64], y_data: &[f64], ) -> Result<(), PlotError>

Plot a scatter plot with X and Y data

Source

pub fn simple_scatter_plot( &self, label: &str, values: &[f64], ) -> Result<(), PlotError>

Plot a simple scatter plot with Y values only (X will be indices)

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick shaded plotting

Source

pub fn shaded_plot( &self, label: &str, x_data: &[f64], y_data: &[f64], ) -> Result<(), PlotError>

Plot a shaded area between a line and Y=0

Source

pub fn shaded_plot_with_ref( &self, label: &str, x_data: &[f64], y_data: &[f64], y_ref: f64, ) -> Result<(), PlotError>

Plot a shaded area between a line and a reference Y value

Source

pub fn shaded_between_plot( &self, label: &str, x_data: &[f64], y1_data: &[f64], y2_data: &[f64], ) -> Result<(), PlotError>

Plot a shaded area between two lines

Source

pub fn simple_shaded_plot( &self, label: &str, values: &[f64], ) -> Result<(), PlotError>

Plot a simple shaded area with Y values only (X will be indices)

Source§

impl<'ui> PlotUi<'ui>

Convenience functions for quick stem plotting

Source

pub fn stem_plot( &self, label: &str, x_data: &[f64], y_data: &[f64], ) -> Result<(), PlotError>

Plot a stem plot with X and Y data

Source

pub fn stem_plot_with_ref( &self, label: &str, x_data: &[f64], y_data: &[f64], y_ref: f64, ) -> Result<(), PlotError>

Plot a stem plot with custom reference Y value

Source

pub fn simple_stem_plot( &self, label: &str, values: &[f64], ) -> Result<(), PlotError>

Plot a simple stem plot with Y values only (X will be indices)

Source

pub fn simple_stem_plot_with_ref( &self, label: &str, values: &[f64], y_ref: f64, ) -> Result<(), PlotError>

Plot a simple stem plot with custom reference Y value

Auto Trait Implementations§

§

impl<'ui> !RefUnwindSafe for PlotUi<'ui>

§

impl<'ui> !Send for PlotUi<'ui>

§

impl<'ui> !Sync for PlotUi<'ui>

§

impl<'ui> !UnwindSafe for PlotUi<'ui>

§

impl<'ui> Freeze for PlotUi<'ui>

§

impl<'ui> Unpin for PlotUi<'ui>

§

impl<'ui> UnsafeUnpin for PlotUi<'ui>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.