fixer_fix/fix42/
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.2".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_on_behalf_of_comp_id(&mut self, v: String) {
152 self.header.set_field(tag::ON_BEHALF_OF_COMP_ID, FIXString::from(v));
153 }
154
155
156 pub fn has_on_behalf_of_comp_id(&self) -> bool {
158 self.header.has(tag::ON_BEHALF_OF_COMP_ID)
159 }
160
161
162
163
164 pub fn set_on_behalf_of_location_id(&mut self, v: String) {
166 self.header.set_field(tag::ON_BEHALF_OF_LOCATION_ID, FIXString::from(v));
167 }
168
169
170 pub fn has_on_behalf_of_location_id(&self) -> bool {
172 self.header.has(tag::ON_BEHALF_OF_LOCATION_ID)
173 }
174
175
176
177
178 pub fn set_on_behalf_of_sending_time(&mut self, v: jiff::Timestamp) {
180 self.header.set_field(tag::ON_BEHALF_OF_SENDING_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
181 time: v,
182 precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
183 });
184 }
185
186
187 pub fn has_on_behalf_of_sending_time(&self) -> bool {
189 self.header.has(tag::ON_BEHALF_OF_SENDING_TIME)
190 }
191
192
193
194
195 pub fn set_on_behalf_of_sub_id(&mut self, v: String) {
197 self.header.set_field(tag::ON_BEHALF_OF_SUB_ID, FIXString::from(v));
198 }
199
200
201 pub fn has_on_behalf_of_sub_id(&self) -> bool {
203 self.header.has(tag::ON_BEHALF_OF_SUB_ID)
204 }
205
206
207
208
209 pub fn set_orig_sending_time(&mut self, v: jiff::Timestamp) {
211 self.header.set_field(tag::ORIG_SENDING_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
212 time: v,
213 precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
214 });
215 }
216
217
218 pub fn has_orig_sending_time(&self) -> bool {
220 self.header.has(tag::ORIG_SENDING_TIME)
221 }
222
223
224
225
226 pub fn set_poss_dup_flag(&mut self, v: bool) {
228 self.header.set_field(tag::POSS_DUP_FLAG, fixer::fix_boolean::FIXBoolean::from(v));
229 }
230
231
232 pub fn has_poss_dup_flag(&self) -> bool {
234 self.header.has(tag::POSS_DUP_FLAG)
235 }
236
237
238
239
240 pub fn set_poss_resend(&mut self, v: bool) {
242 self.header.set_field(tag::POSS_RESEND, fixer::fix_boolean::FIXBoolean::from(v));
243 }
244
245
246 pub fn has_poss_resend(&self) -> bool {
248 self.header.has(tag::POSS_RESEND)
249 }
250
251
252
253
254 pub fn set_secure_data(&mut self, v: String) {
256 self.header.set_field(tag::SECURE_DATA, FIXString::from(v));
257 }
258
259
260 pub fn has_secure_data(&self) -> bool {
262 self.header.has(tag::SECURE_DATA)
263 }
264
265
266
267
268 pub fn set_secure_data_len(&mut self, v: isize) {
270 self.header.set_field(tag::SECURE_DATA_LEN, fixer::fix_int::FIXInt::from(v));
271 }
272
273
274 pub fn has_secure_data_len(&self) -> bool {
276 self.header.has(tag::SECURE_DATA_LEN)
277 }
278
279
280
281
282 pub fn set_sender_comp_id(&mut self, v: String) {
284 self.header.set_field(tag::SENDER_COMP_ID, FIXString::from(v));
285 }
286
287
288 pub fn has_sender_comp_id(&self) -> bool {
290 self.header.has(tag::SENDER_COMP_ID)
291 }
292
293
294
295
296 pub fn set_sender_location_id(&mut self, v: String) {
298 self.header.set_field(tag::SENDER_LOCATION_ID, FIXString::from(v));
299 }
300
301
302 pub fn has_sender_location_id(&self) -> bool {
304 self.header.has(tag::SENDER_LOCATION_ID)
305 }
306
307
308
309
310 pub fn set_sender_sub_id(&mut self, v: String) {
312 self.header.set_field(tag::SENDER_SUB_ID, FIXString::from(v));
313 }
314
315
316 pub fn has_sender_sub_id(&self) -> bool {
318 self.header.has(tag::SENDER_SUB_ID)
319 }
320
321
322
323
324 pub fn set_sending_time(&mut self, v: jiff::Timestamp) {
326 self.header.set_field(tag::SENDING_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
327 time: v,
328 precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
329 });
330 }
331
332
333 pub fn has_sending_time(&self) -> bool {
335 self.header.has(tag::SENDING_TIME)
336 }
337
338
339
340
341 pub fn set_target_comp_id(&mut self, v: String) {
343 self.header.set_field(tag::TARGET_COMP_ID, FIXString::from(v));
344 }
345
346
347 pub fn has_target_comp_id(&self) -> bool {
349 self.header.has(tag::TARGET_COMP_ID)
350 }
351
352
353
354
355 pub fn set_target_location_id(&mut self, v: String) {
357 self.header.set_field(tag::TARGET_LOCATION_ID, FIXString::from(v));
358 }
359
360
361 pub fn has_target_location_id(&self) -> bool {
363 self.header.has(tag::TARGET_LOCATION_ID)
364 }
365
366
367
368
369 pub fn set_target_sub_id(&mut self, v: String) {
371 self.header.set_field(tag::TARGET_SUB_ID, FIXString::from(v));
372 }
373
374
375 pub fn has_target_sub_id(&self) -> bool {
377 self.header.has(tag::TARGET_SUB_ID)
378 }
379
380
381
382
383 pub fn set_xml_data(&mut self, v: String) {
385 self.header.set_field(tag::XML_DATA, FIXString::from(v));
386 }
387
388
389 pub fn has_xml_data(&self) -> bool {
391 self.header.has(tag::XML_DATA)
392 }
393
394
395
396
397 pub fn set_xml_data_len(&mut self, v: isize) {
399 self.header.set_field(tag::XML_DATA_LEN, fixer::fix_int::FIXInt::from(v));
400 }
401
402
403 pub fn has_xml_data_len(&self) -> bool {
405 self.header.has(tag::XML_DATA_LEN)
406 }
407
408
409}