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::{TakeFrom, WireI64};
6
7impl<T: fidl::Timeline> TakeFrom<WireI64> for fidl::Instant<T, fidl::NsUnit> {
8    #[inline]
9    fn take_from(from: &WireI64) -> Self {
10        Self::from_nanos(**from)
11    }
12}
13
14impl<T: fidl::Timeline> TakeFrom<WireI64> for fidl::Instant<T, fidl::TicksUnit> {
15    #[inline]
16    fn take_from(from: &WireI64) -> Self {
17        Self::from_raw(**from)
18    }
19}