Created
July 6, 2016 00:05
-
-
Save jamesmunns/2e094dc138d3ea642a91171d7d444a3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn handler(&self, req: CoAPRequest) -> Option<CoAPResponse> { | |
match req.get_option(CoAPOption::UriPath) { | |
Some(req_path) => { | |
match req.get_class() { | |
MessageClass::RequestType(rq_type) => { | |
match self.map.get(&rq_type) { | |
Some(dispatch) => { | |
dispatch.get(&req_path) | |
}, | |
None => None, | |
} | |
}, | |
_ => None, | |
} | |
}, | |
None => None | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment