Skip to main content

fixer_fix/fix41/
header.rs

1// Code generated by fixer-gen. DO NOT EDIT.
2#![allow(clippy::new_without_default)]
3#![allow(unused_imports)]
4
5use fixer::field_map::FieldMap;
6use fixer::fix_string::FIXString;
7use crate::tag;
8
9/// `Header` is the `fix41` Header type.
10pub struct Header<'a> {
11    pub header: &'a mut FieldMap,
12}
13
14impl Header<'_> {
15    /// Creates a new `Header` wrapping the given message header.
16    pub fn new(header: &mut FieldMap) -> Header<'_> {
17        header.set_field(tag::BEGIN_STRING, FIXString::from("FIX.4.1".to_string()));
18        Header { header }
19    }
20
21
22
23
24    /// Sets `BeginString`, Tag 8.
25    pub fn set_begin_string(&mut self, v: String) {
26        self.header.set_field(tag::BEGIN_STRING, FIXString::from(v));
27    }
28
29
30    /// Returns true if `BeginString` is present, Tag 8.
31    pub fn has_begin_string(&self) -> bool {
32        self.header.has(tag::BEGIN_STRING)
33    }
34
35
36
37
38    /// Sets `BodyLength`, Tag 9.
39    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    /// Returns true if `BodyLength` is present, Tag 9.
45    pub fn has_body_length(&self) -> bool {
46        self.header.has(tag::BODY_LENGTH)
47    }
48
49
50
51
52    /// Sets `DeliverToCompID`, Tag 128.
53    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    /// Returns true if `DeliverToCompID` is present, Tag 128.
59    pub fn has_deliver_to_comp_id(&self) -> bool {
60        self.header.has(tag::DELIVER_TO_COMP_ID)
61    }
62
63
64
65
66    /// Sets `DeliverToLocationID`, Tag 145.
67    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    /// Returns true if `DeliverToLocationID` is present, Tag 145.
73    pub fn has_deliver_to_location_id(&self) -> bool {
74        self.header.has(tag::DELIVER_TO_LOCATION_ID)
75    }
76
77
78
79
80    /// Sets `DeliverToSubID`, Tag 129.
81    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    /// Returns true if `DeliverToSubID` is present, Tag 129.
87    pub fn has_deliver_to_sub_id(&self) -> bool {
88        self.header.has(tag::DELIVER_TO_SUB_ID)
89    }
90
91
92
93
94    /// Sets `MsgSeqNum`, Tag 34.
95    pub fn set_msg_seq_num(&mut self, v: isize) {
96        self.header.set_field(tag::MSG_SEQ_NUM, fixer::fix_int::FIXInt::from(v));
97    }
98
99
100    /// Returns true if `MsgSeqNum` is present, Tag 34.
101    pub fn has_msg_seq_num(&self) -> bool {
102        self.header.has(tag::MSG_SEQ_NUM)
103    }
104
105
106
107
108    /// Sets `MsgType`, Tag 35.
109    pub fn set_msg_type(&mut self, v: String) {
110        self.header.set_field(tag::MSG_TYPE, FIXString::from(v));
111    }
112
113
114    /// Returns true if `MsgType` is present, Tag 35.
115    pub fn has_msg_type(&self) -> bool {
116        self.header.has(tag::MSG_TYPE)
117    }
118
119
120
121
122    /// Sets `OnBehalfOfCompID`, Tag 115.
123    pub fn set_on_behalf_of_comp_id(&mut self, v: String) {
124        self.header.set_field(tag::ON_BEHALF_OF_COMP_ID, FIXString::from(v));
125    }
126
127
128    /// Returns true if `OnBehalfOfCompID` is present, Tag 115.
129    pub fn has_on_behalf_of_comp_id(&self) -> bool {
130        self.header.has(tag::ON_BEHALF_OF_COMP_ID)
131    }
132
133
134
135
136    /// Sets `OnBehalfOfLocationID`, Tag 144.
137    pub fn set_on_behalf_of_location_id(&mut self, v: String) {
138        self.header.set_field(tag::ON_BEHALF_OF_LOCATION_ID, FIXString::from(v));
139    }
140
141
142    /// Returns true if `OnBehalfOfLocationID` is present, Tag 144.
143    pub fn has_on_behalf_of_location_id(&self) -> bool {
144        self.header.has(tag::ON_BEHALF_OF_LOCATION_ID)
145    }
146
147
148
149
150    /// Sets `OnBehalfOfSubID`, Tag 116.
151    pub fn set_on_behalf_of_sub_id(&mut self, v: String) {
152        self.header.set_field(tag::ON_BEHALF_OF_SUB_ID, FIXString::from(v));
153    }
154
155
156    /// Returns true if `OnBehalfOfSubID` is present, Tag 116.
157    pub fn has_on_behalf_of_sub_id(&self) -> bool {
158        self.header.has(tag::ON_BEHALF_OF_SUB_ID)
159    }
160
161
162
163
164    /// Sets `OrigSendingTime`, Tag 122.
165    pub fn set_orig_sending_time(&mut self, v: jiff::Timestamp) {
166        self.header.set_field(tag::ORIG_SENDING_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
167            time: v,
168            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
169        });
170    }
171
172
173    /// Returns true if `OrigSendingTime` is present, Tag 122.
174    pub fn has_orig_sending_time(&self) -> bool {
175        self.header.has(tag::ORIG_SENDING_TIME)
176    }
177
178
179
180
181    /// Sets `PossDupFlag`, Tag 43.
182    pub fn set_poss_dup_flag(&mut self, v: bool) {
183        self.header.set_field(tag::POSS_DUP_FLAG, fixer::fix_boolean::FIXBoolean::from(v));
184    }
185
186
187    /// Returns true if `PossDupFlag` is present, Tag 43.
188    pub fn has_poss_dup_flag(&self) -> bool {
189        self.header.has(tag::POSS_DUP_FLAG)
190    }
191
192
193
194
195    /// Sets `PossResend`, Tag 97.
196    pub fn set_poss_resend(&mut self, v: bool) {
197        self.header.set_field(tag::POSS_RESEND, fixer::fix_boolean::FIXBoolean::from(v));
198    }
199
200
201    /// Returns true if `PossResend` is present, Tag 97.
202    pub fn has_poss_resend(&self) -> bool {
203        self.header.has(tag::POSS_RESEND)
204    }
205
206
207
208
209    /// Sets `SecureData`, Tag 91.
210    pub fn set_secure_data(&mut self, v: String) {
211        self.header.set_field(tag::SECURE_DATA, FIXString::from(v));
212    }
213
214
215    /// Returns true if `SecureData` is present, Tag 91.
216    pub fn has_secure_data(&self) -> bool {
217        self.header.has(tag::SECURE_DATA)
218    }
219
220
221
222
223    /// Sets `SecureDataLen`, Tag 90.
224    pub fn set_secure_data_len(&mut self, v: isize) {
225        self.header.set_field(tag::SECURE_DATA_LEN, fixer::fix_int::FIXInt::from(v));
226    }
227
228
229    /// Returns true if `SecureDataLen` is present, Tag 90.
230    pub fn has_secure_data_len(&self) -> bool {
231        self.header.has(tag::SECURE_DATA_LEN)
232    }
233
234
235
236
237    /// Sets `SenderCompID`, Tag 49.
238    pub fn set_sender_comp_id(&mut self, v: String) {
239        self.header.set_field(tag::SENDER_COMP_ID, FIXString::from(v));
240    }
241
242
243    /// Returns true if `SenderCompID` is present, Tag 49.
244    pub fn has_sender_comp_id(&self) -> bool {
245        self.header.has(tag::SENDER_COMP_ID)
246    }
247
248
249
250
251    /// Sets `SenderLocationID`, Tag 142.
252    pub fn set_sender_location_id(&mut self, v: String) {
253        self.header.set_field(tag::SENDER_LOCATION_ID, FIXString::from(v));
254    }
255
256
257    /// Returns true if `SenderLocationID` is present, Tag 142.
258    pub fn has_sender_location_id(&self) -> bool {
259        self.header.has(tag::SENDER_LOCATION_ID)
260    }
261
262
263
264
265    /// Sets `SenderSubID`, Tag 50.
266    pub fn set_sender_sub_id(&mut self, v: String) {
267        self.header.set_field(tag::SENDER_SUB_ID, FIXString::from(v));
268    }
269
270
271    /// Returns true if `SenderSubID` is present, Tag 50.
272    pub fn has_sender_sub_id(&self) -> bool {
273        self.header.has(tag::SENDER_SUB_ID)
274    }
275
276
277
278
279    /// Sets `SendingTime`, Tag 52.
280    pub fn set_sending_time(&mut self, v: jiff::Timestamp) {
281        self.header.set_field(tag::SENDING_TIME, fixer::fix_utc_timestamp::FIXUTCTimestamp {
282            time: v,
283            precision: fixer::fix_utc_timestamp::TimestampPrecision::Millis,
284        });
285    }
286
287
288    /// Returns true if `SendingTime` is present, Tag 52.
289    pub fn has_sending_time(&self) -> bool {
290        self.header.has(tag::SENDING_TIME)
291    }
292
293
294
295
296    /// Sets `TargetCompID`, Tag 56.
297    pub fn set_target_comp_id(&mut self, v: String) {
298        self.header.set_field(tag::TARGET_COMP_ID, FIXString::from(v));
299    }
300
301
302    /// Returns true if `TargetCompID` is present, Tag 56.
303    pub fn has_target_comp_id(&self) -> bool {
304        self.header.has(tag::TARGET_COMP_ID)
305    }
306
307
308
309
310    /// Sets `TargetLocationID`, Tag 143.
311    pub fn set_target_location_id(&mut self, v: String) {
312        self.header.set_field(tag::TARGET_LOCATION_ID, FIXString::from(v));
313    }
314
315
316    /// Returns true if `TargetLocationID` is present, Tag 143.
317    pub fn has_target_location_id(&self) -> bool {
318        self.header.has(tag::TARGET_LOCATION_ID)
319    }
320
321
322
323
324    /// Sets `TargetSubID`, Tag 57.
325    pub fn set_target_sub_id(&mut self, v: String) {
326        self.header.set_field(tag::TARGET_SUB_ID, FIXString::from(v));
327    }
328
329
330    /// Returns true if `TargetSubID` is present, Tag 57.
331    pub fn has_target_sub_id(&self) -> bool {
332        self.header.has(tag::TARGET_SUB_ID)
333    }
334
335
336}