pub trait Backend: Send + Sync {
type PlotConfig;
// Required methods
fn new() -> Self;
fn initialize(&mut self) -> Result<(), VisualizerError>;
fn plot_1d(
observe_points: Vec<f32>,
acoustic_pressures: Vec<Complex>,
resolution: f32,
x_label: &str,
config: Self::PlotConfig,
) -> Result<(), VisualizerError>;
fn plot_2d(
observe_x: Vec<f32>,
observe_y: Vec<f32>,
acoustic_pressures: Vec<Complex>,
resolution: f32,
x_label: &str,
y_label: &str,
config: Self::PlotConfig,
) -> Result<(), VisualizerError>;
fn plot_modulation(
modulation: Vec<f32>,
config: Self::PlotConfig,
) -> Result<(), VisualizerError>;
fn plot_phase(
config: Self::PlotConfig,
geometry: &Geometry,
phases: Vec<f32>,
) -> Result<(), VisualizerError>;
}
Required Associated Types§
type PlotConfig
Required Methods§
fn new() -> Self
fn initialize(&mut self) -> Result<(), VisualizerError>
fn plot_1d( observe_points: Vec<f32>, acoustic_pressures: Vec<Complex>, resolution: f32, x_label: &str, config: Self::PlotConfig, ) -> Result<(), VisualizerError>
fn plot_2d( observe_x: Vec<f32>, observe_y: Vec<f32>, acoustic_pressures: Vec<Complex>, resolution: f32, x_label: &str, y_label: &str, config: Self::PlotConfig, ) -> Result<(), VisualizerError>
fn plot_modulation( modulation: Vec<f32>, config: Self::PlotConfig, ) -> Result<(), VisualizerError>
fn plot_phase( config: Self::PlotConfig, geometry: &Geometry, phases: Vec<f32>, ) -> Result<(), VisualizerError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.