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

Method to_bytes

lrwn/src/cflist.rs:25–40  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

23 }
24
25 pub fn to_bytes(&self) -> Result<[u8; 16]> {
26 let mut b: [u8; 16] = [0; 16];
27
28 match self {
29 CFList::Channels(v) => {
30 b[..15].clone_from_slice(&v.to_bytes()?);
31 b[15] = 0x00;
32 }
33 CFList::ChannelMask(v) => {
34 b[..15].clone_from_slice(&v.to_bytes()?);
35 b[15] = 0x01;
36 }
37 }
38
39 Ok(b)
40 }
41}
42
43#[derive(Debug, PartialEq, Eq, Clone)]

Callers

nothing calls this directly

Calls 2

iterMethod · 0.80
to_le_bytesMethod · 0.45

Tested by

no test coverage detected