(&self)
| 27 | |
| 28 | impl DeviceQueueItem { |
| 29 | fn validate(&self) -> Result<(), Error> { |
| 30 | if self.f_port == 0 || self.f_port > 255 { |
| 31 | return Err(Error::Validation( |
| 32 | "FPort must be between 1 - 255".to_string(), |
| 33 | )); |
| 34 | } |
| 35 | |
| 36 | if self.is_encrypted && self.f_cnt_down.is_none() { |
| 37 | return Err(Error::Validation( |
| 38 | "FCntDown must be set for encrypted queue-items".to_string(), |
| 39 | )); |
| 40 | } |
| 41 | |
| 42 | Ok(()) |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | impl Default for DeviceQueueItem { |
no test coverage detected