1// Copyright 2019 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
45use fidl_fuchsia_wlan_ieee80211 as fidl_ieee80211;
6use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout};
78#[repr(C)]
9#[derive(
10 IntoBytes, KnownLayout, FromBytes, Immutable, PartialEq, Eq, Clone, Copy, Debug, Default,
11)]
12pub struct ReasonCode(pub u16);
1314impl From<fidl_ieee80211::ReasonCode> for ReasonCode {
15fn from(fidl_reason_code: fidl_ieee80211::ReasonCode) -> ReasonCode {
16 ReasonCode(fidl_reason_code.into_primitive())
17 }
18}
1920impl From<ReasonCode> for Option<fidl_ieee80211::ReasonCode> {
21fn from(reason_code: ReasonCode) -> Option<fidl_ieee80211::ReasonCode> {
22 fidl_ieee80211::ReasonCode::from_primitive(reason_code.0)
23 }
24}