rocl/models/
service_binding_endpoint.rs1#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ServiceBindingEndpoint {
16 #[serde(rename = "host")]
17 pub host: String,
18 #[serde(rename = "ports")]
19 pub ports: Vec<String>,
20 #[serde(rename = "protocol", skip_serializing_if = "Option::is_none")]
21 pub protocol: Option<Protocol>,
22}
23
24impl ServiceBindingEndpoint {
25 pub fn new(host: String, ports: Vec<String>) -> ServiceBindingEndpoint {
26 ServiceBindingEndpoint {
27 host,
28 ports,
29 protocol: None,
30 }
31 }
32}
33
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Protocol {
37 #[serde(rename = "tcp")]
38 Tcp,
39 #[serde(rename = "udp")]
40 Udp,
41 #[serde(rename = "all")]
42 All,
43}
44