/
germanubis
/
criterion.rs
Обзор
Документация
Войти
/
germanubis
/
criterion.rs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
plot/src/traits.rs
35 строк
904 B
Brook Heisler
Updated to Rust 2018.
05 авг 2019, 19:44
05 авг 2019, 19:44
61ee4e4
Код
Авторство
О чём код?
//! Traits /// Overloaded `configure` method pub trait Configure<This> { /// The properties of what's being configured type Properties; /// Configure some set of properties fn configure<F>(&mut self, this: This, function: F) -> &mut Self where F: FnOnce(&mut Self::Properties) -> &mut Self::Properties; } /// Types that can be plotted pub trait Data { /// Convert the type into a double precision float fn f64(self) -> f64; } /// Overloaded `plot` method pub trait Plot<This> { /// The properties associated to the plot type Properties; /// Plots some `data` with some `configuration` fn plot<F>(&mut self, this: This, function: F) -> &mut Self where F: FnOnce(&mut Self::Properties) -> &mut Self::Properties; } /// Overloaded `set` method pub trait Set<T> { /// Sets some property fn set(&mut self, value: T) -> &mut Self; }