rateslib/scheduling/
dcfs.rs1use pyo3::{pyclass, pyfunction};
2use serde::{Deserialize, Serialize};
3use std::cmp::PartialEq;
4
5#[pyclass(module = "rateslib.rs", eq, eq_int)]
6#[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)]
7pub enum Convention {
8 One,
10 OnePlus,
12 Act365F,
14 Act365FPlus,
16 Act360,
18 ThirtyE360,
19 Thirty360,
20 Thirty360ISDA,
21 ActActISDA,
22 ActActICMA,
23 Bus252,
24}
25
26#[pyfunction]
27pub(crate) fn _get_convention_str(convention: Convention) -> String {
28 match convention {
29 Convention::Act365F => "Act365F".to_string(),
30 Convention::Act365FPlus => "Act365F+".to_string(),
31 Convention::Act360 => "Act360".to_string(),
32 Convention::Thirty360 => "30360".to_string(),
33 Convention::ThirtyE360 => "30e360".to_string(),
34 Convention::Thirty360ISDA => "30e360ISDA".to_string(),
35 Convention::ActActISDA => "ActActISDA".to_string(),
36 Convention::ActActICMA => "ActActICMA".to_string(),
37 Convention::One => "1".to_string(),
38 Convention::OnePlus => "1+".to_string(),
39 Convention::Bus252 => "Bus252".to_string(),
40 }
41}