dis_rs/common/set_record_r/
builder.rs

1use crate::common::model::EntityId;
2use crate::enumerations::RequiredReliabilityService;
3use crate::model::RecordSpecification;
4use crate::set_record_r::model::SetRecordR;
5
6pub struct SetRecordRBuilder(SetRecordR);
7
8impl Default for SetRecordRBuilder {
9    fn default() -> Self {
10        Self::new()
11    }
12}
13
14impl SetRecordRBuilder {
15    #[must_use]
16    pub fn new() -> Self {
17        SetRecordRBuilder(SetRecordR::default())
18    }
19
20    #[must_use]
21    pub fn new_from_body(body: SetRecordR) -> Self {
22        SetRecordRBuilder(body)
23    }
24
25    #[must_use]
26    pub fn build(self) -> SetRecordR {
27        self.0
28    }
29
30    #[must_use]
31    pub fn with_origination_id(mut self, originating_id: EntityId) -> Self {
32        self.0.originating_id = originating_id;
33        self
34    }
35
36    #[must_use]
37    pub fn with_receiving_id(mut self, receiving_id: EntityId) -> Self {
38        self.0.receiving_id = receiving_id;
39        self
40    }
41
42    #[must_use]
43    pub fn with_request_id(mut self, request_id: u32) -> Self {
44        self.0.request_id = request_id;
45        self
46    }
47
48    #[must_use]
49    pub fn with_required_reliability_service(
50        mut self,
51        required_reliability_service: RequiredReliabilityService,
52    ) -> Self {
53        self.0.required_reliability_service = required_reliability_service;
54        self
55    }
56
57    #[must_use]
58    pub fn with_record_specification(mut self, record_specification: RecordSpecification) -> Self {
59        self.0.record_specification = record_specification;
60        self
61    }
62}