fidl_next_codec/
compat.rs

1// Copyright 2025 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.
4
5use crate::{FromWire, FromWireRef, WireI64};
6
7impl<T: fidl::Timeline> FromWire<WireI64> for fidl::Instant<T, fidl::NsUnit> {
8    #[inline]
9    fn from_wire(wire: WireI64) -> Self {
10        Self::from_wire_ref(&wire)
11    }
12}
13
14impl<T: fidl::Timeline> FromWireRef<WireI64> for fidl::Instant<T, fidl::NsUnit> {
15    #[inline]
16    fn from_wire_ref(wire: &WireI64) -> Self {
17        Self::from_nanos(**wire)
18    }
19}
20
21impl<T: fidl::Timeline> FromWire<WireI64> for fidl::Instant<T, fidl::TicksUnit> {
22    #[inline]
23    fn from_wire(wire: WireI64) -> Self {
24        Self::from_wire_ref(&wire)
25    }
26}
27
28impl<T: fidl::Timeline> FromWireRef<WireI64> for fidl::Instant<T, fidl::TicksUnit> {
29    #[inline]
30    fn from_wire_ref(wire: &WireI64) -> Self {
31        Self::from_raw(**wire)
32    }
33}