openthread/ot/types/
lowpan_context_info.rs1use crate::prelude_internal::*;
6
7use core::fmt::{Debug, Formatter};
8
9#[derive(Default, Clone)]
12#[repr(transparent)]
13pub struct LowpanContextInfo(pub otLowpanContextInfo);
14
15impl_ot_castable!(LowpanContextInfo, otLowpanContextInfo);
16
17impl Debug for LowpanContextInfo {
18 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
19 f.debug_struct("LowpanContextInfo")
20 .field("compress_flag", &self.compress_flag())
21 .field("context_id", &self.context_id())
22 .field("prefix", &self.prefix())
23 .field("is_stable", &self.is_stable())
24 .finish()
25 }
26}
27
28impl LowpanContextInfo {
29 pub fn compress_flag(&self) -> bool {
31 self.0.mCompressFlag()
32 }
33
34 pub fn context_id(&self) -> u8 {
36 self.0.mContextId
37 }
38
39 pub fn prefix(&self) -> &Ip6Prefix {
41 (&self.0.mPrefix).into()
42 }
43
44 pub fn is_stable(&self) -> bool {
46 self.0.mStable()
47 }
48}