ctb_workspace_ipc/services/
io.generated.rs

1// SPDX-License-Identifier: AGPL-3.0-or-later
2/*
3This file is part of Collective Toolbox, a database and document workspace and utilities.
4Copyright (C) 2026 Collective Toolbox Developers
5Contact: info@collectivetoolbox.com
6
7This program is free software: you can redistribute it and/or modify it under
8the terms of the GNU Affero General Public License as published by the Free
9Software Foundation, either version 3 of the License, or (at your option) any
10later version.
11
12This program is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
15
16You should have received a copy of the GNU Affero General Public License along
17with this program.  If not, see <https://www.gnu.org/licenses/>.
18*/
19
20// IPC service for io process.
21//
22// @generated by ctb-build-support::ipc_codegen
23// Do not edit by hand.
24
25// DTO conversion helpers (service DTO -> service crate type)
26
27fn to_ctb_io_environment_env_description(v: &::ctb_utilities::ipc::service_traits::io::EnvDescription) -> ::ctb_io_environment::EnvDescription {
28    ::ctb_io_environment::EnvDescription {
29        os: v.os.clone(),
30        usize_width: v.usize_width.clone(),
31        ctb_version: v.ctb_version.clone(),
32        cwd: v.cwd.clone(),
33        local_ips: v.local_ips.clone(),
34        public_ips: v.public_ips.clone(),
35        system_time_resolution_nanos: v.system_time_resolution_nanos.clone(),
36        server_system_time_offset_nanos: v.server_system_time_offset_nanos.clone(),
37        is_release_build: v.is_release_build.clone(),
38        is_debug_build: v.is_debug_build.clone(),
39        is_cargo_target_binary: v.is_cargo_target_binary.clone(),
40        is_in_test: v.is_in_test.clone(),
41        is_branded_build: v.is_branded_build.clone(),
42        is_official_signed_build: v.is_official_signed_build.clone(),
43        is_cli_lightweight: v.is_cli_lightweight.clone(),
44        is_workspace: v.is_workspace.clone(),
45        is_workspace_main_process: v.is_workspace_main_process.clone(),
46        is_service_subprocess: v.is_service_subprocess.clone(),
47        is_official_public_website: v.is_official_public_website.clone(),
48        is_public_website: v.is_public_website.clone(),
49        is_local: v.is_local.clone(),
50        kernel_version: v.kernel_version.clone(),
51        supported_formats: v.supported_formats.clone(),
52    }
53}
54
55fn to_ctb_io_environment_os_family(v: &::ctb_utilities::ipc::service_traits::io::OsFamily) -> ::ctb_io_environment::OsFamily {
56    match v {
57        ::ctb_utilities::ipc::service_traits::io::OsFamily::Darwin => ::ctb_io_environment::OsFamily::Darwin,
58        ::ctb_utilities::ipc::service_traits::io::OsFamily::FreeBSD => ::ctb_io_environment::OsFamily::FreeBSD,
59        ::ctb_utilities::ipc::service_traits::io::OsFamily::OpenBSD => ::ctb_io_environment::OsFamily::OpenBSD,
60        ::ctb_utilities::ipc::service_traits::io::OsFamily::NetBSD => ::ctb_io_environment::OsFamily::NetBSD,
61        ::ctb_utilities::ipc::service_traits::io::OsFamily::DragonFly => ::ctb_io_environment::OsFamily::DragonFly,
62        ::ctb_utilities::ipc::service_traits::io::OsFamily::Linux => ::ctb_io_environment::OsFamily::Linux,
63        ::ctb_utilities::ipc::service_traits::io::OsFamily::Windows => ::ctb_io_environment::OsFamily::Windows,
64        ::ctb_utilities::ipc::service_traits::io::OsFamily::Other => ::ctb_io_environment::OsFamily::Other,
65    }
66}
67
68
69ipc_service_client! {
70    service: io,
71    methods: {
72        async fn print(&self, document: Vec < u8 >) -> Result<()>
73            => ::ctb_io::PrintIpcClientExt(document);
74        async fn print_string(&self, document: & str) -> Result<()>
75            => ::ctb_io::PrintStringIpcClientExt(document.to_string());
76        async fn start_local_webui(&self) -> Result<u16>
77            => ::ctb_io::StartLocalWebuiIpcClientExt();
78    }
79}