parse_sap_odata/sap_annotations/
mod.rs

1use crate::utils::{de_str_to_bool, default_false, default_true};
2
3pub mod aggregation_role;
4pub mod association_set;
5pub mod display_format;
6pub mod entity_container;
7pub mod entity_set;
8pub mod entity_type;
9pub mod field_control;
10pub mod filter_restriction;
11pub mod function_import;
12pub mod navigation_property;
13pub mod parameter;
14pub mod property;
15pub mod schema;
16
17// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
18pub trait AnnotationType {
19    fn member_name(&self) -> Vec<u8>;
20}
21
22pub trait OptionalAnnotationType {
23    fn opt_anno_type<T: AnnotationType>(&self, opt_self: &Option<T>) -> Vec<u8>;
24}
25
26// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
27static ATOM: &str = "atom";
28static ONE: &str = "1";
29static JSON: &str = "json";
30
31// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
32pub fn default_sap_content_version() -> String {
33    ONE.to_string()
34}
35pub fn default_sap_schema_version() -> String {
36    ONE.to_string()
37}
38pub fn default_entity_container_supported_formats() -> Vec<String> {
39    vec![String::from(ATOM), String::from(JSON)]
40}