(&self)
| 36 | |
| 37 | impl Gateway { |
| 38 | fn validate(&self) -> Result<(), Error> { |
| 39 | if self.name.is_empty() { |
| 40 | return Err(Error::Validation("name is not set".into())); |
| 41 | } |
| 42 | |
| 43 | if self.downlink_priority <= 0 { |
| 44 | return Err(Error::Validation("downlink_priority must be > 0".into())); |
| 45 | } |
| 46 | |
| 47 | Ok(()) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | impl Default for Gateway { |