autd3_core/gain/error.rs
1use derive_more::Display;
2use thiserror::Error;
3
4#[derive(Error, Debug, Display, PartialEq, Clone)]
5#[display("{}", msg)]
6/// An error occurred during gain calculation.
7pub struct GainError {
8 msg: String,
9}
10
11impl GainError {
12 /// Creates a new [`GainError`].
13 #[must_use]
14 pub fn new(msg: impl ToString) -> Self {
15 Self {
16 msg: msg.to_string(),
17 }
18 }
19}