fixer_fix/fix44/
header.rs1#![allow(clippy::new_without_default)]
3#![allow(unused_imports)]
4
5use fixer::field_map::FieldMap;
6use fixer::fix_string::FIXString;
7use crate::tag;
8
9pub struct Header<'a> {
11 pub header: &'a mut FieldMap,
12}
13
14impl Header<'_> {
15 pub fn new(header: &mut FieldMap) -> Header<'_> {
17 header.set_field(tag::BEGIN_STRING, FIXString::from("FIX.4.4".to_string()));
18 Header { header }
19 }
20
21
22
23
24 pub fn set_begin_string(&mut self, v: String) {
26 self.header.set_field(tag::BEGIN_STRING, FIXString::from(v));
27 }
28
29
30 pub fn has_begin_string(&self) -> bool {
32 self.header.has(tag::BEGIN_STRING)
33 }
34
35
36
37
38 pub fn set_body_length(&mut self, v: isize) {
40 self.header.set_field(tag::BODY_LENGTH, fixer::fix_int::FIXInt::from(v));
41 }
42
43
44 pub fn has_body_length(&self) -> bool {
46 self.header.has(tag::BODY_LENGTH)
47 }
48
49
50
51
52 pub fn set_deliver_to_comp_id(&mut self, v: String) {
54 self.header.set_field(tag::DELIVER_TO_COMP_ID, FIXString::from(v));
55 }
56
57
58 pub fn has_deliver_to_comp_id(&self) -> bool {
60 self.header.has(tag::DELIVER_TO_COMP_ID)
61 }
62
63
64
65
66 pub fn set_deliver_to_location_id(&mut self, v: String) {
68 self.header.set_field(tag::DELIVER_TO_LOCATION_ID, FIXString::from(v));
69 }
70
71
72 pub fn has_deliver_to_location_id(&self) -> bool {
74 self.header.has(tag::DELIVER_TO_LOCATION_ID)
75 }
76
77
78
79
80 pub fn set_deliver_to_sub_id(&mut self, v: String) {
82 self.header.set_field(tag::DELIVER_TO_SUB_ID, FIXString::from(v));
83 }
84
85
86 pub fn has_deliver_to_sub_id(&self) -> bool {
88 self.header.has(tag::DELIVER_TO_SUB_ID)
89 }
90
91
92
93
94 pub fn set_last_msg_seq_num_processed(&mut self, v: isize) {
96 self.header.set_field(tag::LAST_MSG_SEQ_NUM_PROCESSED, fixer::fix_int::FIXInt::from(v));
97 }
98
99
100 pub fn has_last_msg_seq_num_processed(&self) -> bool {
102 self.header.has(tag::LAST_MSG_SEQ_NUM_PROCESSED)
103 }
104
105
106
107
108 pub fn set_message_encoding(&mut self, v: String) {
110 self.header.set_field(tag::MESSAGE_ENCODING, FIXString::from(v));
111 }
112
113
114 pub fn has_message_encoding(&self) -> bool {
116 self.header.has(tag::MESSAGE_ENCODING)
117 }
118
119
120
121
122 pub fn set_msg_seq_num(&mut self, v: isize) {
124 self.header.set_field(tag::MSG_SEQ_NUM, fixer::fix_int::FIXInt::from(v));
125 }
126
127
128 pub fn has_msg_seq_num(&self) -> bool {
130 self.header.has(tag::MSG_SEQ_NUM)
131 }
132
133
134
135
136 pub fn set_msg_type(&mut self, v: String) {
138 self.header.set_field(tag::MSG_TYPE, FIXString::from(v));
139 }
140
141
142 pub fn has_msg_type(&self) -> bool {
144 self.header.has(tag::MSG_TYPE)
145 }
146
147
148
149
150 pub fn set_no_hops(&mut self, v: isize) {
152 self.header.set_field(tag::NO_HOPS, fixer::fix_int::FIXInt::from(v));
153 }
154
155
156 pub fn has_no_hops(&self) -> bool {
158 self.header.has(tag::NO_HOPS)
159 }
160
161
162
163
164 pub fn set_on_behalf_of_comp_id(&mut self, v: String) {
166 self.header.set_field(tag::ON_BEHALF_OF_COMP_ID, FIXString::from(v));
167 }
168
169
170 pub fn has_on_behalf_of_comp_id(&self) -> bool {
172 self.header.has(tag::ON_BEHALF_OF_COMP_ID)
173 }
174
175
176
177
178 pub fn set_on_behalf_of_location_id(&mut self, v: String) {
180 self.header.set_field(tag::ON_BEHALF_OF_LOCATION_ID, FIXString::from(v));
181 }
182
183
184 pub fn has_on_behalf_of_location_id(&self) -> bool {
186 self.header.has(tag::ON_BEHALF_OF_LOCATION_ID)
187 }
188
189
190
191
192 pub fn set_on_behalf_of_sub_id(&mut self, v: String) {
194 self.header.set_field(tag::ON_BEHALF_OF_SUB_ID, FIXString::from(v));
195 }
196
197
198 pub fn has_on_behalf_of_sub_id(&self) -> bool {
200 self.header.has(tag::ON_BEHALF_OF_SUB_ID)
201 }
202
203
204
205
206 pub fn set_orig_sending_time(&mut self, v: jiff::Timestamp) {
208 self.header.set_field(tag::ORIG_SENDING_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
209 time: v,
210 precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
211 });
212 }
213
214
215 pub fn has_orig_sending_time(&self) -> bool {
217 self.header.has(tag::ORIG_SENDING_TIME)
218 }
219
220
221
222
223 pub fn set_poss_dup_flag(&mut self, v: bool) {
225 self.header.set_field(tag::POSS_DUP_FLAG, fixer::fix_boolean::FIXBoolean::from(v));
226 }
227
228
229 pub fn has_poss_dup_flag(&self) -> bool {
231 self.header.has(tag::POSS_DUP_FLAG)
232 }
233
234
235
236
237 pub fn set_poss_resend(&mut self, v: bool) {
239 self.header.set_field(tag::POSS_RESEND, fixer::fix_boolean::FIXBoolean::from(v));
240 }
241
242
243 pub fn has_poss_resend(&self) -> bool {
245 self.header.has(tag::POSS_RESEND)
246 }
247
248
249
250
251 pub fn set_secure_data(&mut self, v: String) {
253 self.header.set_field(tag::SECURE_DATA, FIXString::from(v));
254 }
255
256
257 pub fn has_secure_data(&self) -> bool {
259 self.header.has(tag::SECURE_DATA)
260 }
261
262
263
264
265 pub fn set_secure_data_len(&mut self, v: isize) {
267 self.header.set_field(tag::SECURE_DATA_LEN, fixer::fix_int::FIXInt::from(v));
268 }
269
270
271 pub fn has_secure_data_len(&self) -> bool {
273 self.header.has(tag::SECURE_DATA_LEN)
274 }
275
276
277
278
279 pub fn set_sender_comp_id(&mut self, v: String) {
281 self.header.set_field(tag::SENDER_COMP_ID, FIXString::from(v));
282 }
283
284
285 pub fn has_sender_comp_id(&self) -> bool {
287 self.header.has(tag::SENDER_COMP_ID)
288 }
289
290
291
292
293 pub fn set_sender_location_id(&mut self, v: String) {
295 self.header.set_field(tag::SENDER_LOCATION_ID, FIXString::from(v));
296 }
297
298
299 pub fn has_sender_location_id(&self) -> bool {
301 self.header.has(tag::SENDER_LOCATION_ID)
302 }
303
304
305
306
307 pub fn set_sender_sub_id(&mut self, v: String) {
309 self.header.set_field(tag::SENDER_SUB_ID, FIXString::from(v));
310 }
311
312
313 pub fn has_sender_sub_id(&self) -> bool {
315 self.header.has(tag::SENDER_SUB_ID)
316 }
317
318
319
320
321 pub fn set_sending_time(&mut self, v: jiff::Timestamp) {
323 self.header.set_field(tag::SENDING_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
324 time: v,
325 precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
326 });
327 }
328
329
330 pub fn has_sending_time(&self) -> bool {
332 self.header.has(tag::SENDING_TIME)
333 }
334
335
336
337
338 pub fn set_target_comp_id(&mut self, v: String) {
340 self.header.set_field(tag::TARGET_COMP_ID, FIXString::from(v));
341 }
342
343
344 pub fn has_target_comp_id(&self) -> bool {
346 self.header.has(tag::TARGET_COMP_ID)
347 }
348
349
350
351
352 pub fn set_target_location_id(&mut self, v: String) {
354 self.header.set_field(tag::TARGET_LOCATION_ID, FIXString::from(v));
355 }
356
357
358 pub fn has_target_location_id(&self) -> bool {
360 self.header.has(tag::TARGET_LOCATION_ID)
361 }
362
363
364
365
366 pub fn set_target_sub_id(&mut self, v: String) {
368 self.header.set_field(tag::TARGET_SUB_ID, FIXString::from(v));
369 }
370
371
372 pub fn has_target_sub_id(&self) -> bool {
374 self.header.has(tag::TARGET_SUB_ID)
375 }
376
377
378
379
380 pub fn set_xml_data(&mut self, v: String) {
382 self.header.set_field(tag::XML_DATA, FIXString::from(v));
383 }
384
385
386 pub fn has_xml_data(&self) -> bool {
388 self.header.has(tag::XML_DATA)
389 }
390
391
392
393
394 pub fn set_xml_data_len(&mut self, v: isize) {
396 self.header.set_field(tag::XML_DATA_LEN, fixer::fix_int::FIXInt::from(v));
397 }
398
399
400 pub fn has_xml_data_len(&self) -> bool {
402 self.header.has(tag::XML_DATA_LEN)
403 }
404
405
406}