gui_server_api/msg/
camera.rs

1// SPDX-FileCopyrightText: 2024 Foundation Devices, Inc. <hello@foundation.xyz>
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4use server::{AsScalar, FromScalar};
5
6#[derive(Debug, server::Message)]
7pub struct ShowCamera {
8    pub y_pos: u16,
9}
10impl FromScalar<1> for ShowCamera {
11    fn from_scalar([y_pos]: [u32; 1]) -> Self { Self { y_pos: y_pos as u16 } }
12}
13impl AsScalar<1> for ShowCamera {
14    fn as_scalar(&self) -> [u32; 1] { [self.y_pos as u32] }
15}
16
17#[derive(Debug, server::Message)]
18pub struct HideCamera;