MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / validate

Method validate

chirpstack/src/storage/gateway.rs:38–48  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

36
37impl 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
51impl Default for Gateway {

Callers 2

createFunction · 0.45
updateFunction · 0.45

Calls 1

intoMethod · 0.45

Tested by

no test coverage detected