server/macros.rs
1// SPDX-FileCopyrightText: 2024 Foundation Devices, Inc. <hello@foundation.xyz>
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4#[macro_export]
5macro_rules! wrapped_scalar {
6 ($name:ty) => {
7 impl $crate::FromScalar<4> for $name {
8 fn from_scalar(value: [u32; 4]) -> Self { Self($crate::FromScalar::from_scalar(value)) }
9 }
10
11 impl $crate::AsScalar<4> for $name {
12 fn as_scalar(&self) -> [u32; 4] { self.0.as_scalar() }
13 }
14 };
15}