aboutsummaryrefslogtreecommitdiff
path: root/src/statistics/math.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2020-04-04 13:48:56 +0200
committerDaniel Schadt <kingdread@gmx.de>2020-04-04 13:55:20 +0200
commit4ec62bbac872bbfd95413af2f00c3f4a36c70630 (patch)
tree22cac1ff6f9776565d9f35322c463ec6125c0bc7 /src/statistics/math.rs
parent22738da2cd36b4ae2e1fb5efd23373e6b77405a2 (diff)
downloadevtclib-4ec62bbac872bbfd95413af2f00c3f4a36c70630.tar.gz
evtclib-4ec62bbac872bbfd95413af2f00c3f4a36c70630.tar.bz2
evtclib-4ec62bbac872bbfd95413af2f00c3f4a36c70630.zip
switch from quick_error to thiserror
thiserror seems to be the more modern approach that also works with the new Error trait from std.
Diffstat (limited to 'src/statistics/math.rs')
-rw-r--r--src/statistics/math.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/statistics/math.rs b/src/statistics/math.rs
index b7dd6ac..a0849a3 100644
--- a/src/statistics/math.rs
+++ b/src/statistics/math.rs
@@ -25,7 +25,8 @@ pub trait Monoid: Semigroup {
}
#[derive(Debug, Clone)]
-struct Record<X, T, D> {
+#[doc(hidden)]
+pub struct Record<X, T, D> {
x: X,
tag: T,
data: D,
@@ -63,6 +64,11 @@ where
RecordFunc { data: Vec::new() }
}
+ #[doc(hidden)]
+ pub fn data(&self) -> &[Record<X, T, D>] {
+ &self.data
+ }
+
/// Insert a data point into the record func.
///
/// Note that you should supply the *increment*, not the *absolute value*!