openthread/ot/
infra_if.rsuse crate::prelude_internal::*;
pub trait InfraInterface {
fn plat_infra_if_on_state_changed(&self, id: u32, is_running: bool);
fn plat_infra_if_discover_nat64_prefix_done(&self, infra_if_idx: u32, ip6_prefix: Ip6Prefix);
}
impl<T: InfraInterface + ot::Boxable> InfraInterface for ot::Box<T> {
fn plat_infra_if_on_state_changed(&self, id: u32, is_running: bool) {
self.as_ref().plat_infra_if_on_state_changed(id, is_running);
}
fn plat_infra_if_discover_nat64_prefix_done(&self, infra_if_idx: u32, ip6_prefix: Ip6Prefix) {
self.as_ref().plat_infra_if_discover_nat64_prefix_done(infra_if_idx, ip6_prefix);
}
}
impl InfraInterface for Instance {
fn plat_infra_if_on_state_changed(&self, id: u32, is_running: bool) {
unsafe {
otPlatInfraIfStateChanged(self.as_ot_ptr(), id, is_running);
}
}
fn plat_infra_if_discover_nat64_prefix_done(&self, infra_if_idx: u32, ip6_prefix: Ip6Prefix) {
unsafe {
otPlatInfraIfDiscoverNat64PrefixDone(self.as_ot_ptr(), infra_if_idx, &ip6_prefix.into())
}
}
}