libreda_sta/traits/load_base.rs
1// SPDX-FileCopyrightText: 2022 Thomas Kramer <code@tkramer.ch>
2//
3// SPDX-License-Identifier: AGPL-3.0-or-later
4
5//! Base trait used as an abstraction of electrical loads.
6
7use num_traits::Zero;
8
9use blanket::blanket;
10
11/// Base trait used as an abstraction of electrical loads.
12#[blanket(derive(Ref))]
13pub trait LoadBase {
14 /// An electrical load. Typically a capacitance.
15 type Load: Clone + std::fmt::Debug + Zero + Send + Sync;
16
17 /// Compute the sum of two loads.
18 fn sum_loads(&self, load1: &Self::Load, load2: &Self::Load) -> Self::Load;
19}