bacnet_client/client/
builder_options.rs1use super::*;
2
3impl<T: TransportPort + 'static> ClientBuilder<T> {
4 pub fn apdu_retries(mut self, retries: u8) -> Self {
6 self.config.apdu_retries = retries;
7 self
8 }
9
10 pub fn max_segments(mut self, max_segments: Option<u8>) -> Self {
15 self.config.max_segments = max_segments;
16 self
17 }
18
19 pub fn segmented_response_accepted(mut self, accepted: bool) -> Self {
21 self.config.segmented_response_accepted = accepted;
22 self
23 }
24
25 pub fn proposed_window_size(mut self, window_size: u8) -> Self {
27 self.config.proposed_window_size = window_size;
28 self
29 }
30
31 pub fn confirmed_cov_notification_ack_policy<F>(mut self, policy: F) -> Self
33 where
34 F: Fn(&ReceivedCOVNotification) -> ConfirmedCOVNotificationResponse + Send + Sync + 'static,
35 {
36 self.options = self
37 .options
38 .with_confirmed_cov_notification_ack_policy(policy);
39 self
40 }
41}
42
43impl BipClientBuilder {
44 pub fn apdu_retries(mut self, retries: u8) -> Self {
46 self.config.apdu_retries = retries;
47 self
48 }
49
50 pub fn max_segments(mut self, max_segments: Option<u8>) -> Self {
55 self.config.max_segments = max_segments;
56 self
57 }
58
59 pub fn segmented_response_accepted(mut self, accepted: bool) -> Self {
61 self.config.segmented_response_accepted = accepted;
62 self
63 }
64
65 pub fn proposed_window_size(mut self, window_size: u8) -> Self {
67 self.config.proposed_window_size = window_size;
68 self
69 }
70
71 pub fn confirmed_cov_notification_ack_policy<F>(mut self, policy: F) -> Self
73 where
74 F: Fn(&ReceivedCOVNotification) -> ConfirmedCOVNotificationResponse + Send + Sync + 'static,
75 {
76 self.options = self
77 .options
78 .with_confirmed_cov_notification_ack_policy(policy);
79 self
80 }
81}
82
83#[cfg(feature = "ipv6")]
84impl Bip6ClientBuilder {
85 pub fn apdu_retries(mut self, retries: u8) -> Self {
87 self.config.apdu_retries = retries;
88 self
89 }
90
91 pub fn max_segments(mut self, max_segments: Option<u8>) -> Self {
96 self.config.max_segments = max_segments;
97 self
98 }
99
100 pub fn segmented_response_accepted(mut self, accepted: bool) -> Self {
102 self.config.segmented_response_accepted = accepted;
103 self
104 }
105
106 pub fn proposed_window_size(mut self, window_size: u8) -> Self {
108 self.config.proposed_window_size = window_size;
109 self
110 }
111
112 pub fn confirmed_cov_notification_ack_policy<F>(mut self, policy: F) -> Self
114 where
115 F: Fn(&ReceivedCOVNotification) -> ConfirmedCOVNotificationResponse + Send + Sync + 'static,
116 {
117 self.options = self
118 .options
119 .with_confirmed_cov_notification_ack_policy(policy);
120 self
121 }
122}
123
124#[cfg(feature = "sc-tls")]
125impl ScClientBuilder {
126 pub fn apdu_retries(mut self, retries: u8) -> Self {
128 self.config.apdu_retries = retries;
129 self
130 }
131
132 pub fn max_segments(mut self, max_segments: Option<u8>) -> Self {
137 self.config.max_segments = max_segments;
138 self
139 }
140
141 pub fn segmented_response_accepted(mut self, accepted: bool) -> Self {
143 self.config.segmented_response_accepted = accepted;
144 self
145 }
146
147 pub fn proposed_window_size(mut self, window_size: u8) -> Self {
149 self.config.proposed_window_size = window_size;
150 self
151 }
152
153 pub fn confirmed_cov_notification_ack_policy<F>(mut self, policy: F) -> Self
155 where
156 F: Fn(&ReceivedCOVNotification) -> ConfirmedCOVNotificationResponse + Send + Sync + 'static,
157 {
158 self.options = self
159 .options
160 .with_confirmed_cov_notification_ack_policy(policy);
161 self
162 }
163}