pub struct HtmlReportOptions<'a> {
pub benchmark: Option<&'a ReturnSeries>,
pub rf: f64,
pub grayscale: bool,
pub title: String,
pub output: Option<PathBuf>,
pub compounded: bool,
pub periods_per_year: u32,
pub template_path: Option<PathBuf>,
pub match_dates: bool,
pub strategy_title: Option<String>,
pub benchmark_title: Option<String>,
}Fields§
§benchmark: Option<&'a ReturnSeries>§rf: f64§grayscale: bool§title: String§output: Option<PathBuf>§compounded: bool§periods_per_year: u32§template_path: Option<PathBuf>§match_dates: bool§strategy_title: Option<String>§benchmark_title: Option<String>Implementations§
Source§impl<'a> HtmlReportOptions<'a>
impl<'a> HtmlReportOptions<'a>
Sourcepub fn with_benchmark(self, benchmark: &'a ReturnSeries) -> Self
pub fn with_benchmark(self, benchmark: &'a ReturnSeries) -> Self
Examples found in repository?
examples/html_with_benchmark.rs (line 11)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 // Use shared demo data from examples/common.rs (generated from data file)
7 let strategy = common::demo_strategy();
8 let benchmark = common::demo_benchmark();
9
10 let options = HtmlReportOptions::default()
11 .with_benchmark(&benchmark)
12 .with_title("Quantstats-rs Demo Tearsheet (with Benchmark)")
13 .with_strategy_title("Strategy")
14 .with_benchmark_title("Benchmark Index")
15 .with_output("tearsheet_with_benchmark.html");
16
17 let html = html(&strategy, options)?;
18
19 println!(
20 "Generated HTML report with benchmark ({} bytes) at tearsheet_with_benchmark.html",
21 html.len()
22 );
23
24 Ok(())
25}Sourcepub fn with_output<P: AsRef<Path>>(self, path: P) -> Self
pub fn with_output<P: AsRef<Path>>(self, path: P) -> Self
Examples found in repository?
examples/html_report.rs (line 12)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 // Use shared demo data from examples/common.rs (generated from data file)
7 let series = common::demo_strategy();
8
9 let options = HtmlReportOptions::default()
10 .with_title("Quantstats-rs Demo Tearsheet")
11 .with_strategy_title("Demo Strategy")
12 .with_output("tearsheet.html");
13
14 let html = html(&series, options)?;
15
16 println!(
17 "Generated HTML report ({} bytes) at tearsheet.html",
18 html.len()
19 );
20
21 Ok(())
22}More examples
examples/html_with_benchmark.rs (line 15)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 // Use shared demo data from examples/common.rs (generated from data file)
7 let strategy = common::demo_strategy();
8 let benchmark = common::demo_benchmark();
9
10 let options = HtmlReportOptions::default()
11 .with_benchmark(&benchmark)
12 .with_title("Quantstats-rs Demo Tearsheet (with Benchmark)")
13 .with_strategy_title("Strategy")
14 .with_benchmark_title("Benchmark Index")
15 .with_output("tearsheet_with_benchmark.html");
16
17 let html = html(&strategy, options)?;
18
19 println!(
20 "Generated HTML report with benchmark ({} bytes) at tearsheet_with_benchmark.html",
21 html.len()
22 );
23
24 Ok(())
25}Sourcepub fn with_title<S: Into<String>>(self, title: S) -> Self
pub fn with_title<S: Into<String>>(self, title: S) -> Self
Examples found in repository?
examples/html_report.rs (line 10)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 // Use shared demo data from examples/common.rs (generated from data file)
7 let series = common::demo_strategy();
8
9 let options = HtmlReportOptions::default()
10 .with_title("Quantstats-rs Demo Tearsheet")
11 .with_strategy_title("Demo Strategy")
12 .with_output("tearsheet.html");
13
14 let html = html(&series, options)?;
15
16 println!(
17 "Generated HTML report ({} bytes) at tearsheet.html",
18 html.len()
19 );
20
21 Ok(())
22}More examples
examples/html_with_benchmark.rs (line 12)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 // Use shared demo data from examples/common.rs (generated from data file)
7 let strategy = common::demo_strategy();
8 let benchmark = common::demo_benchmark();
9
10 let options = HtmlReportOptions::default()
11 .with_benchmark(&benchmark)
12 .with_title("Quantstats-rs Demo Tearsheet (with Benchmark)")
13 .with_strategy_title("Strategy")
14 .with_benchmark_title("Benchmark Index")
15 .with_output("tearsheet_with_benchmark.html");
16
17 let html = html(&strategy, options)?;
18
19 println!(
20 "Generated HTML report with benchmark ({} bytes) at tearsheet_with_benchmark.html",
21 html.len()
22 );
23
24 Ok(())
25}Sourcepub fn with_strategy_title<S: Into<String>>(self, title: S) -> Self
pub fn with_strategy_title<S: Into<String>>(self, title: S) -> Self
Examples found in repository?
examples/html_report.rs (line 11)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 // Use shared demo data from examples/common.rs (generated from data file)
7 let series = common::demo_strategy();
8
9 let options = HtmlReportOptions::default()
10 .with_title("Quantstats-rs Demo Tearsheet")
11 .with_strategy_title("Demo Strategy")
12 .with_output("tearsheet.html");
13
14 let html = html(&series, options)?;
15
16 println!(
17 "Generated HTML report ({} bytes) at tearsheet.html",
18 html.len()
19 );
20
21 Ok(())
22}More examples
examples/html_with_benchmark.rs (line 13)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 // Use shared demo data from examples/common.rs (generated from data file)
7 let strategy = common::demo_strategy();
8 let benchmark = common::demo_benchmark();
9
10 let options = HtmlReportOptions::default()
11 .with_benchmark(&benchmark)
12 .with_title("Quantstats-rs Demo Tearsheet (with Benchmark)")
13 .with_strategy_title("Strategy")
14 .with_benchmark_title("Benchmark Index")
15 .with_output("tearsheet_with_benchmark.html");
16
17 let html = html(&strategy, options)?;
18
19 println!(
20 "Generated HTML report with benchmark ({} bytes) at tearsheet_with_benchmark.html",
21 html.len()
22 );
23
24 Ok(())
25}Sourcepub fn with_benchmark_title<S: Into<String>>(self, title: S) -> Self
pub fn with_benchmark_title<S: Into<String>>(self, title: S) -> Self
Examples found in repository?
examples/html_with_benchmark.rs (line 14)
5fn main() -> Result<(), Box<dyn std::error::Error>> {
6 // Use shared demo data from examples/common.rs (generated from data file)
7 let strategy = common::demo_strategy();
8 let benchmark = common::demo_benchmark();
9
10 let options = HtmlReportOptions::default()
11 .with_benchmark(&benchmark)
12 .with_title("Quantstats-rs Demo Tearsheet (with Benchmark)")
13 .with_strategy_title("Strategy")
14 .with_benchmark_title("Benchmark Index")
15 .with_output("tearsheet_with_benchmark.html");
16
17 let html = html(&strategy, options)?;
18
19 println!(
20 "Generated HTML report with benchmark ({} bytes) at tearsheet_with_benchmark.html",
21 html.len()
22 );
23
24 Ok(())
25}pub fn with_template_path<P: AsRef<Path>>(self, path: P) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for HtmlReportOptions<'a>
impl<'a> RefUnwindSafe for HtmlReportOptions<'a>
impl<'a> Send for HtmlReportOptions<'a>
impl<'a> Sync for HtmlReportOptions<'a>
impl<'a> Unpin for HtmlReportOptions<'a>
impl<'a> UnwindSafe for HtmlReportOptions<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more