From 436bf05e0bcb70e260c416f9166e1fd1dfbb554f Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 21 Jan 2020 11:56:56 +0100 Subject: [PATCH] merge api, sys and tools into proxmox directly Signed-off-by: Wolfgang Bumiller --- Cargo.toml | 4 -- Makefile | 12 ++--- proxmox-api-macro/Cargo.toml | 3 +- proxmox-api/Cargo.toml | 35 ------------- proxmox-api/debian/changelog | 23 --------- proxmox-api/debian/copyright | 16 ------ proxmox-api/debian/debcargo.toml | 8 --- proxmox-sys/Cargo.toml | 23 --------- proxmox-sys/debian/changelog | 44 ---------------- proxmox-sys/debian/copyright | 16 ------ proxmox-sys/debian/debcargo.toml | 8 --- proxmox-tools/Cargo.toml | 33 ------------ proxmox-tools/debian/changelog | 21 -------- proxmox-tools/debian/copyright | 16 ------ proxmox-tools/debian/debcargo.toml | 8 --- proxmox/Cargo.toml | 50 ++++++++++++++++--- proxmox/debian/changelog | 7 +++ proxmox/debian/copyright | 2 +- {proxmox-api/src => proxmox/src/api}/cli.rs | 2 +- .../src => proxmox/src/api}/cli/command.rs | 6 +-- .../src => proxmox/src/api}/cli/completion.rs | 4 +- .../src/api}/cli/environment.rs | 2 +- .../src => proxmox/src/api}/cli/format.rs | 4 +- .../src => proxmox/src/api}/cli/getopts.rs | 2 +- .../src => proxmox/src/api}/cli/readline.rs | 0 .../src => proxmox/src/api}/cli/shellword.rs | 0 .../src => proxmox/src/api}/const_regex.rs | 6 +-- {proxmox-api/src => proxmox/src/api}/error.rs | 4 +- .../src => proxmox/src/api}/format.rs | 8 +-- .../src/lib.rs => proxmox/src/api/mod.rs | 6 +++ .../src => proxmox/src/api}/router.rs | 19 +++---- .../src/api}/rpc_environment.rs | 2 +- .../src => proxmox/src/api}/schema.rs | 11 ++-- proxmox/src/lib.rs | 25 ++++------ {proxmox-sys/src => proxmox/src/sys}/error.rs | 6 +-- {proxmox-sys/src => proxmox/src/sys}/linux.rs | 3 +- .../src => proxmox/src/sys}/linux/magic.rs | 0 .../src => proxmox/src/sys}/linux/pid.rs | 6 +-- .../src => proxmox/src/sys}/linux/procfs.rs | 4 +- .../src/sys}/linux/procfs/mountinfo.rs | 0 .../src => proxmox/src/sys}/macros.rs | 0 .../src/lib.rs => proxmox/src/sys/mod.rs | 0 .../src => proxmox/src/tools}/as_any.rs | 0 .../src => proxmox/src/tools}/borrow.rs | 0 .../src => proxmox/src/tools}/common_regex.rs | 0 .../src => proxmox/src/tools}/fd.rs | 0 .../src => proxmox/src/tools}/fs.rs | 4 +- .../src => proxmox/src/tools}/io.rs | 0 .../src => proxmox/src/tools}/io/read.rs | 2 +- .../src => proxmox/src/tools}/io/write.rs | 0 .../src/lib.rs => proxmox/src/tools/mod.rs | 16 ++---- .../src => proxmox/src/tools}/parse.rs | 0 .../src => proxmox/src/tools}/serde.rs | 6 +-- .../src => proxmox/src/tools}/uuid.rs | 6 +-- .../src => proxmox/src/tools}/vec.rs | 2 +- .../src => proxmox/src/tools}/vec/byte_vec.rs | 0 56 files changed, 129 insertions(+), 356 deletions(-) delete mode 100644 proxmox-api/Cargo.toml delete mode 100644 proxmox-api/debian/changelog delete mode 100644 proxmox-api/debian/copyright delete mode 100644 proxmox-api/debian/debcargo.toml delete mode 100644 proxmox-sys/Cargo.toml delete mode 100644 proxmox-sys/debian/changelog delete mode 100644 proxmox-sys/debian/copyright delete mode 100644 proxmox-sys/debian/debcargo.toml delete mode 100644 proxmox-tools/Cargo.toml delete mode 100644 proxmox-tools/debian/changelog delete mode 100644 proxmox-tools/debian/copyright delete mode 100644 proxmox-tools/debian/debcargo.toml rename {proxmox-api/src => proxmox/src/api}/cli.rs (99%) rename {proxmox-api/src => proxmox/src/api}/cli/command.rs (99%) rename {proxmox-api/src => proxmox/src/api}/cli/completion.rs (99%) rename {proxmox-api/src => proxmox/src/api}/cli/environment.rs (94%) rename {proxmox-api/src => proxmox/src/api}/cli/format.rs (99%) rename {proxmox-api/src => proxmox/src/api}/cli/getopts.rs (99%) rename {proxmox-api/src => proxmox/src/api}/cli/readline.rs (100%) rename {proxmox-api/src => proxmox/src/api}/cli/shellword.rs (100%) rename {proxmox-api/src => proxmox/src/api}/const_regex.rs (92%) rename {proxmox-api/src => proxmox/src/api}/error.rs (84%) rename {proxmox-api/src => proxmox/src/api}/format.rs (98%) rename proxmox-api/src/lib.rs => proxmox/src/api/mod.rs (84%) rename {proxmox-api/src => proxmox/src/api}/router.rs (96%) rename {proxmox-api/src => proxmox/src/api}/rpc_environment.rs (97%) rename {proxmox-api/src => proxmox/src/api}/schema.rs (99%) rename {proxmox-sys/src => proxmox/src/sys}/error.rs (97%) rename {proxmox-sys/src => proxmox/src/sys}/linux.rs (91%) rename {proxmox-sys/src => proxmox/src/sys}/linux/magic.rs (100%) rename {proxmox-sys/src => proxmox/src/sys}/linux/pid.rs (97%) rename {proxmox-sys/src => proxmox/src/sys}/linux/procfs.rs (99%) rename {proxmox-sys/src => proxmox/src/sys}/linux/procfs/mountinfo.rs (100%) rename {proxmox-sys/src => proxmox/src/sys}/macros.rs (100%) rename proxmox-sys/src/lib.rs => proxmox/src/sys/mod.rs (100%) rename {proxmox-tools/src => proxmox/src/tools}/as_any.rs (100%) rename {proxmox-tools/src => proxmox/src/tools}/borrow.rs (100%) rename {proxmox-tools/src => proxmox/src/tools}/common_regex.rs (100%) rename {proxmox-tools/src => proxmox/src/tools}/fd.rs (100%) rename {proxmox-tools/src => proxmox/src/tools}/fs.rs (99%) rename {proxmox-tools/src => proxmox/src/tools}/io.rs (100%) rename {proxmox-tools/src => proxmox/src/tools}/io/read.rs (99%) rename {proxmox-tools/src => proxmox/src/tools}/io/write.rs (100%) rename proxmox-tools/src/lib.rs => proxmox/src/tools/mod.rs (93%) rename {proxmox-tools/src => proxmox/src/tools}/parse.rs (100%) rename {proxmox-tools/src => proxmox/src/tools}/serde.rs (93%) rename {proxmox-tools/src => proxmox/src/tools}/uuid.rs (97%) rename {proxmox-tools/src => proxmox/src/tools}/vec.rs (98%) rename {proxmox-tools/src => proxmox/src/tools}/vec/byte_vec.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 428ef941..d6dc7b4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,8 @@ [workspace] members = [ "proxmox", - "proxmox-api", "proxmox-api-macro", "proxmox-sortable-macro", - "proxmox-sys", - "proxmox-tools", - "proxmox", ] exclude = [ "build", diff --git a/Makefile b/Makefile index 2c1bd537..626b5727 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Shortcut for common operations: -CRATES=proxmox proxmox-api proxmox-api-macro proxmox-sortable-macro proxmox-sys proxmox-tools +CRATES=proxmox proxmox-api-macro proxmox-sortable-macro # By default we just run checks: .PHONY: all @@ -12,14 +12,8 @@ deb: $(foreach c,$(CRATES), $c-deb) lintian build/*.deb .PHONY: dinstall -dinstall: - $(MAKE) proxmox-tools-deb proxmox-sortable-macro-deb - sudo dpkg -i build/librust-*.deb - $(MAKE) proxmox-api-macro-deb proxmox-sys-deb - sudo dpkg -i build/librust-*.deb - $(MAKE) proxmox-deb - sudo dpkg -i build/librust-*.deb - sudo -k +dinstall: deb + sudo -k dpkg -i build/librust-*.deb %-deb: ./build.sh $* diff --git a/proxmox-api-macro/Cargo.toml b/proxmox-api-macro/Cargo.toml index 522ef369..5b267043 100644 --- a/proxmox-api-macro/Cargo.toml +++ b/proxmox-api-macro/Cargo.toml @@ -19,8 +19,7 @@ syn = { version = "1.0", features = [ "full" ] } [dev-dependencies] futures = "0.3" -proxmox = { path = "../proxmox" } -proxmox-api = { path = "../proxmox-api", features = [ "test-harness" ] } +proxmox = { path = "../proxmox", features = [ "test-harness" ] } serde = "1.0" serde_derive = "1.0" serde_json = "1.0" diff --git a/proxmox-api/Cargo.toml b/proxmox-api/Cargo.toml deleted file mode 100644 index b7f1859e..00000000 --- a/proxmox-api/Cargo.toml +++ /dev/null @@ -1,35 +0,0 @@ -[package] -name = "proxmox-api" -edition = "2018" -version = "0.1.2" -authors = [ "Wolfgang Bumiller " ] -license = "AGPL-3" -description = "Proxmox API library" - -exclude = [ "debian" ] - -[dependencies] -bytes = "0.5" -failure = "0.1" -futures = "0.3" -http = "0.2" -proxmox-tools = { version = "0.1.1", path = "../proxmox-tools" } -regex = "1.2" -rustyline = "5.0.5" -serde = "1.0" -serde_derive = "1.0" -serde_json = "1.0" -textwrap = "0.11" -url = "2.1" - -tokio = { version = "0.2", features = [], optional = true } -hyper = { version = "0.13", optional = true } - -[dev-dependencies] -lazy_static = "1.4" - -[features] -default = [ "router", "cli" ] -router = [ "hyper", "tokio" ] -cli = [ "router", "hyper", "tokio" ] -test-harness = [] diff --git a/proxmox-api/debian/changelog b/proxmox-api/debian/changelog deleted file mode 100644 index d3e89ad7..00000000 --- a/proxmox-api/debian/changelog +++ /dev/null @@ -1,23 +0,0 @@ -rust-proxmox-api (0.1.2-1) unstable; urgency=medium - - * improve generate_usage_str() - - -- Proxmox Support Team Wed, 15 Jan 2020 15:21:40 +0100 - -rust-proxmox-api (0.1.1-1) proxmox-rust; urgency=medium - - * switch packaging to debcargo with local crate support - - -- Proxmox Support Team Mon, 13 Jan 2020 10:41:01 +0100 - -rust-proxmox-api (0.1.1) proxmox-rust; urgency=medium - - * bump proxmox-tools dependency - - -- Proxmox Support Team Thu, 02 Jan 2020 14:25:22 +0100 - -rust-proxmox-api (0.1.0) proxmox-rust; urgency=medium - - * Initial packaging. - - -- Proxmox Support Team Tue, 17 Dec 2019 14:47:44 +0100 diff --git a/proxmox-api/debian/copyright b/proxmox-api/debian/copyright deleted file mode 100644 index ae43835f..00000000 --- a/proxmox-api/debian/copyright +++ /dev/null @@ -1,16 +0,0 @@ -Copyright (C) 2019 Proxmox Server Solutions GmbH - -This software is written by Proxmox Server Solutions GmbH - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . diff --git a/proxmox-api/debian/debcargo.toml b/proxmox-api/debian/debcargo.toml deleted file mode 100644 index 4ac0cfb7..00000000 --- a/proxmox-api/debian/debcargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -overlay = "." -crate_src_path = ".." - -[source] -# TODO: update once public -vcs_git = "" -vcs_browser = "" -maintainer = "Proxmox Support Team " diff --git a/proxmox-sys/Cargo.toml b/proxmox-sys/Cargo.toml deleted file mode 100644 index 659d85d8..00000000 --- a/proxmox-sys/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "proxmox-sys" -edition = "2018" -version = "0.1.3" -authors = [ - "Dietmar Maurer ", - "Wolfgang Bumiller ", -] -license = "AGPL-3" -description = "Proxmox system library" - -exclude = [ "debian" ] - -[dependencies] -failure = "0.1" -lazy_static = "1.4" -libc = "0.2" -nix = "0.16" -proxmox-tools = { version = "0.1.2", path = "../proxmox-tools" } - -# Docs should be able to reference the proxmox crate. -[dev-dependencies] -proxmox = { path = "../proxmox" } diff --git a/proxmox-sys/debian/changelog b/proxmox-sys/debian/changelog deleted file mode 100644 index 60add474..00000000 --- a/proxmox-sys/debian/changelog +++ /dev/null @@ -1,44 +0,0 @@ -rust-proxmox-sys (0.1.3-1) proxmox-rust; urgency=medium - - * rename PidStat::read_for_pid -> read_from_pid - - * sys: drop deprecated items - - -- Proxmox Support Team Thu, 16 Jan 2020 11:34:14 +0100 - -rust-proxmox-sys (0.1.2-1) proxmox-rust; urgency=medium - - * Add helper macros for ffi code: c_try, c_result, io_bail, io_bail_last, - io_format_err, c_str - - * Add SysResult and SysError traits which provide convenient methods to - convert nix::Results and nix::Errors to std::io::Result and - std::io::Error. - - * Extend /proc/PID/stat parsing by pid, ppid and num_threads - - * Rename ProcFsPidStat to PidStat, deprecate standalone functions for it. - - * Add /proc/PID/mountinfo parsing (proxmox::sys::procfs::MountInfo) - - * Add proxmox::sys::pid::PidFd for pidfd handling - - -- Proxmox Support Team Wed, 15 Jan 2020 15:31:05 +0100 - -rust-proxmox-sys (0.1.1-1) proxmox-rust; urgency=medium - - * switch packaging to debcargo with local crate support - - -- Proxmox Support Team Mon, 13 Jan 2020 10:41:01 +0100 - -rust-proxmox-sys (0.1.1) proxmox-rust; urgency=medium - - * added: various helpers for dealing with nix and io errors - - -- Proxmox Support Team Thu, 02 Jan 2020 14:32:44 +0100 - -rust-proxmox-sys (0.1.0) proxmox-rust; urgency=medium - - * Initial packaging. - - -- Proxmox Support Team Tue, 17 Dec 2019 14:47:44 +0100 diff --git a/proxmox-sys/debian/copyright b/proxmox-sys/debian/copyright deleted file mode 100644 index ae43835f..00000000 --- a/proxmox-sys/debian/copyright +++ /dev/null @@ -1,16 +0,0 @@ -Copyright (C) 2019 Proxmox Server Solutions GmbH - -This software is written by Proxmox Server Solutions GmbH - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . diff --git a/proxmox-sys/debian/debcargo.toml b/proxmox-sys/debian/debcargo.toml deleted file mode 100644 index 4ac0cfb7..00000000 --- a/proxmox-sys/debian/debcargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -overlay = "." -crate_src_path = ".." - -[source] -# TODO: update once public -vcs_git = "" -vcs_browser = "" -maintainer = "Proxmox Support Team " diff --git a/proxmox-tools/Cargo.toml b/proxmox-tools/Cargo.toml deleted file mode 100644 index 60e610ea..00000000 --- a/proxmox-tools/Cargo.toml +++ /dev/null @@ -1,33 +0,0 @@ -[package] -name = "proxmox-tools" -edition = "2018" -version = "0.1.2" -authors = [ - "Dietmar Maurer ", - "Wolfgang Bumiller ", -] -license = "AGPL-3" -description = "Proxmox tools" - -exclude = [ "debian" ] - -[dependencies] -base64 = "0.10" -chrono = "0.4" -endian_trait = { version = "0.6", features = ["arrays"] } -failure = "0.1" -lazy_static = "1.4" -libc = "0.2" -nix = "0.16" -regex = "1.2" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -valgrind_request = { git = "https://github.com/edef1c/libvalgrind_request", version = "1.1.0", optional = true } - -[features] -default = [] -valgrind = [ "valgrind_request" ] - -# Docs should be able to reference the proxmox crate. -[dev-dependencies] -proxmox = { path = "../proxmox" } diff --git a/proxmox-tools/debian/changelog b/proxmox-tools/debian/changelog deleted file mode 100644 index f93f53e7..00000000 --- a/proxmox-tools/debian/changelog +++ /dev/null @@ -1,21 +0,0 @@ -rust-proxmox-tools (0.1.2-1) unstable; urgency=medium - - * take a reference to the dirfd in Fd::openat - - * remove accidentally commited debian/files - - * switch packaging to debcargo with local crate support - - -- Proxmox Support Team Mon, 13 Jan 2020 10:41:01 +0100 - -rust-proxmox-tools (0.1.1) proxmox-rust; urgency=medium - - * correctly default to mode 0644 in replace_file - - -- Proxmox Support Team Thu, 02 Jan 2020 14:38:22 +0100 - -rust-proxmox-tools (0.1.0) proxmox-rust; urgency=medium - - * Initial packaging. - - -- Proxmox Support Team Tue, 17 Dec 2019 13:50:53 +0100 diff --git a/proxmox-tools/debian/copyright b/proxmox-tools/debian/copyright deleted file mode 100644 index ae43835f..00000000 --- a/proxmox-tools/debian/copyright +++ /dev/null @@ -1,16 +0,0 @@ -Copyright (C) 2019 Proxmox Server Solutions GmbH - -This software is written by Proxmox Server Solutions GmbH - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see . diff --git a/proxmox-tools/debian/debcargo.toml b/proxmox-tools/debian/debcargo.toml deleted file mode 100644 index 4ac0cfb7..00000000 --- a/proxmox-tools/debian/debcargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -overlay = "." -crate_src_path = ".." - -[source] -# TODO: update once public -vcs_git = "" -vcs_browser = "" -maintainer = "Proxmox Support Team " diff --git a/proxmox/Cargo.toml b/proxmox/Cargo.toml index fb842f45..9a0ad5b4 100644 --- a/proxmox/Cargo.toml +++ b/proxmox/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "proxmox" edition = "2018" -version = "0.1.4" +version = "0.1.5" authors = [ "Dietmar Maurer ", "Wolfgang Bumiller ", @@ -12,16 +12,50 @@ description = "Proxmox library" exclude = [ "debian" ] [dependencies] -proxmox-api = { path = "../proxmox-api", default-features = false, version = "0.1.2" } +# General dependencies +failure = "0.1" +lazy_static = "1.4" +libc = "0.2" +nix = "0.16" + +# tools module: +base64 = "0.10" +chrono = "0.4" +endian_trait = { version = "0.6", features = ["arrays"] } +regex = "1.2" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +valgrind_request = { git = "https://github.com/edef1c/libvalgrind_request", version = "1.1.0", optional = true } +# libc, nix, lazy_static + +# sys module: +# libc, nix, lazy_static + +# api module: +bytes = "0.5" +futures = "0.3" +http = "0.2" +hyper = { version = "0.13", optional = true } +rustyline = "5.0.5" +serde_derive = "1.0" +textwrap = "0.11" +tokio = { version = "0.2", features = [], optional = true } +url = "2.1" +#regex, serde, serde_json + +# Macro crates: proxmox-api-macro = { path = "../proxmox-api-macro", optional = true, version = "0.1.1" } -proxmox-sys = { path = "../proxmox-sys", version = "0.1.3" } -proxmox-tools = { path = "../proxmox-tools", version = "0.1.2" } proxmox-sortable-macro = { path = "../proxmox-sortable-macro", optional = true, version = "0.1.0" } [features] -api-macro = ["proxmox-api-macro"] -cli = ["proxmox-api/cli"] default = [ "router", "cli" ] -router = ["proxmox-api/router"] sortable-macro = ["proxmox-sortable-macro"] -valgrind = ["proxmox-tools/valgrind"] + +# api: +api-macro = ["proxmox-api-macro"] +test-harness = [] +cli = [ "router", "hyper", "tokio" ] +router = [ "hyper", "tokio" ] + +# tools: +#valgrind = ["proxmox-tools/valgrind"] diff --git a/proxmox/debian/changelog b/proxmox/debian/changelog index c4c33fce..a97c4ecd 100644 --- a/proxmox/debian/changelog +++ b/proxmox/debian/changelog @@ -1,3 +1,10 @@ +rust-proxmox (0.1.5-1) unstable; urgency=medium + + * merge tools, sys and api crate into the proxmox main crate to reduce + the dependency management burden + + -- Proxmox Support Team Tue, 21 Jan 2020 12:13:18 +0100 + rust-proxmox (0.1.4-1) unstable; urgency=medium * sys: rename PidStat::read_for_pid -> read_from_pid diff --git a/proxmox/debian/copyright b/proxmox/debian/copyright index ae43835f..2c91d38c 100644 --- a/proxmox/debian/copyright +++ b/proxmox/debian/copyright @@ -1,4 +1,4 @@ -Copyright (C) 2019 Proxmox Server Solutions GmbH +Copyright (C) 2019,2020 Proxmox Server Solutions GmbH This software is written by Proxmox Server Solutions GmbH diff --git a/proxmox-api/src/cli.rs b/proxmox/src/api/cli.rs similarity index 99% rename from proxmox-api/src/cli.rs rename to proxmox/src/api/cli.rs index 166255ea..bab8a007 100644 --- a/proxmox-api/src/cli.rs +++ b/proxmox/src/api/cli.rs @@ -35,7 +35,7 @@ pub use readline::*; use std::collections::HashMap; -use crate::ApiMethod; +use crate::api::ApiMethod; /// Completion function for single parameters. /// diff --git a/proxmox-api/src/cli/command.rs b/proxmox/src/api/cli/command.rs similarity index 99% rename from proxmox-api/src/cli/command.rs rename to proxmox/src/api/cli/command.rs index 76fe448c..b2279c9f 100644 --- a/proxmox-api/src/cli/command.rs +++ b/proxmox/src/api/cli/command.rs @@ -3,9 +3,9 @@ use serde_json::Value; use std::cell::RefCell; use std::sync::Arc; -use crate::format::*; -use crate::schema::*; -use crate::*; +use crate::api::format::*; +use crate::api::schema::*; +use crate::api::*; use super::environment::CliEnvironment; diff --git a/proxmox-api/src/cli/completion.rs b/proxmox/src/api/cli/completion.rs similarity index 99% rename from proxmox-api/src/cli/completion.rs rename to proxmox/src/api/cli/completion.rs index 25935c9c..1b067139 100644 --- a/proxmox-api/src/cli/completion.rs +++ b/proxmox/src/api/cli/completion.rs @@ -1,6 +1,6 @@ use super::*; -use crate::schema::*; +use crate::api::schema::*; fn record_done_argument( done: &mut HashMap, @@ -295,7 +295,7 @@ mod test { use failure::*; use serde_json::Value; - use crate::{cli::*, schema::*, *}; + use crate::api::{cli::*, schema::*, *}; fn dummy_method( _param: Value, diff --git a/proxmox-api/src/cli/environment.rs b/proxmox/src/api/cli/environment.rs similarity index 94% rename from proxmox-api/src/cli/environment.rs rename to proxmox/src/api/cli/environment.rs index 2b46bd75..fdba039f 100644 --- a/proxmox-api/src/cli/environment.rs +++ b/proxmox/src/api/cli/environment.rs @@ -1,7 +1,7 @@ use serde_json::Value; use std::collections::HashMap; -use crate::{RpcEnvironment, RpcEnvironmentType}; +use crate::api::{RpcEnvironment, RpcEnvironmentType}; /// `RpcEnvironmet` implementation for command line tools #[derive(Default)] diff --git a/proxmox-api/src/cli/format.rs b/proxmox/src/api/cli/format.rs similarity index 99% rename from proxmox-api/src/cli/format.rs rename to proxmox/src/api/cli/format.rs index 36f4c19d..4aaa3986 100644 --- a/proxmox-api/src/cli/format.rs +++ b/proxmox/src/api/cli/format.rs @@ -4,8 +4,8 @@ use serde_json::Value; use std::collections::HashSet; -use crate::format::*; -use crate::schema::*; +use crate::api::format::*; +use crate::api::schema::*; use super::{CliCommand, CliCommandMap, CommandLineInterface}; diff --git a/proxmox-api/src/cli/getopts.rs b/proxmox/src/api/cli/getopts.rs similarity index 99% rename from proxmox-api/src/cli/getopts.rs rename to proxmox/src/api/cli/getopts.rs index 3f80eb91..f279923f 100644 --- a/proxmox-api/src/cli/getopts.rs +++ b/proxmox/src/api/cli/getopts.rs @@ -1,7 +1,7 @@ use failure::*; use serde_json::Value; -use crate::schema::*; +use crate::api::schema::*; #[derive(Debug)] enum RawArgument { diff --git a/proxmox-api/src/cli/readline.rs b/proxmox/src/api/cli/readline.rs similarity index 100% rename from proxmox-api/src/cli/readline.rs rename to proxmox/src/api/cli/readline.rs diff --git a/proxmox-api/src/cli/shellword.rs b/proxmox/src/api/cli/shellword.rs similarity index 100% rename from proxmox-api/src/cli/shellword.rs rename to proxmox/src/api/cli/shellword.rs diff --git a/proxmox-api/src/const_regex.rs b/proxmox/src/api/const_regex.rs similarity index 92% rename from proxmox-api/src/const_regex.rs rename to proxmox/src/api/const_regex.rs index f3644985..68a4c0ab 100644 --- a/proxmox-api/src/const_regex.rs +++ b/proxmox/src/api/const_regex.rs @@ -30,7 +30,7 @@ impl std::ops::Deref for ConstRegexPattern { /// Macro to generate a ConstRegexPattern /// /// ``` -/// # use proxmox_api::*; +/// # use proxmox::const_regex; /// # /// const_regex!{ /// FILE_EXTENSION_REGEX = r".*\.([a-zA-Z]+)$"; @@ -53,8 +53,8 @@ macro_rules! const_regex { ($($pub:tt)*) $(#[$attr:meta])* $name:ident = $regex:expr; $($rest:tt)* ) => { - $(#[$attr])* $($pub)* const $name: $crate::const_regex::ConstRegexPattern = - $crate::const_regex::ConstRegexPattern { + $(#[$attr])* $($pub)* const $name: $crate::api::const_regex::ConstRegexPattern = + $crate::api::const_regex::ConstRegexPattern { regex_string: $regex, regex_obj: (|| -> &'static ::regex::Regex { ::lazy_static::lazy_static! { diff --git a/proxmox-api/src/error.rs b/proxmox/src/api/error.rs similarity index 84% rename from proxmox-api/src/error.rs rename to proxmox/src/api/error.rs index df3dd029..4c063fa3 100644 --- a/proxmox-api/src/error.rs +++ b/proxmox/src/api/error.rs @@ -28,8 +28,8 @@ impl fmt::Display for HttpError { #[macro_export] macro_rules! http_err { ($status:ident, $msg:expr) => {{ - ::failure::Error::from($crate::error::HttpError::new( - $crate::error::StatusCode::$status, + ::failure::Error::from($crate::api::error::HttpError::new( + $crate::api::error::StatusCode::$status, $msg, )) }}; diff --git a/proxmox-api/src/format.rs b/proxmox/src/api/format.rs similarity index 98% rename from proxmox-api/src/format.rs rename to proxmox/src/api/format.rs index 28d63c2a..38928ec4 100644 --- a/proxmox-api/src/format.rs +++ b/proxmox/src/api/format.rs @@ -4,8 +4,8 @@ use failure::Error; use std::io::Write; -use crate::schema::*; -use crate::{ApiHandler, ApiMethod}; +use crate::api::schema::*; +use crate::api::{ApiHandler, ApiMethod}; /// Enumerate different styles to display parameters/properties. #[derive(Copy, Clone)] @@ -265,11 +265,11 @@ fn dump_method_definition(method: &str, path: &str, def: Option<&ApiMethod>) -> /// Generate ReST Documentaion for a complete API defined by a ``Router``. pub fn dump_api( output: &mut dyn Write, - router: &crate::Router, + router: &crate::api::Router, path: &str, mut pos: usize, ) -> Result<(), Error> { - use crate::SubRoute; + use crate::api::SubRoute; let mut cond_print = |x| -> Result<_, Error> { if let Some(text) = x { diff --git a/proxmox-api/src/lib.rs b/proxmox/src/api/mod.rs similarity index 84% rename from proxmox-api/src/lib.rs rename to proxmox/src/api/mod.rs index 36dae420..c9455a78 100644 --- a/proxmox-api/src/lib.rs +++ b/proxmox/src/api/mod.rs @@ -1,5 +1,8 @@ //! Proxmox API module. This provides utilities for HTTP and command line APIs. +#[cfg(feature = "api-macro")] +pub use proxmox_api_macro::{api, router}; + #[doc(hidden)] pub mod const_regex; #[doc(hidden)] @@ -35,3 +38,6 @@ pub use router::{ #[cfg(feature = "cli")] pub mod cli; + +#[cfg(feature = "api-macro")] +pub use proxmox_api_macro::{api, router}; diff --git a/proxmox-api/src/router.rs b/proxmox/src/api/router.rs similarity index 96% rename from proxmox-api/src/router.rs rename to proxmox/src/api/router.rs index e8aa6026..f53e52bf 100644 --- a/proxmox-api/src/router.rs +++ b/proxmox/src/api/router.rs @@ -9,8 +9,8 @@ use http::{Method, Response}; use hyper::Body; use serde_json::Value; -use crate::schema::{self, ObjectSchema, Schema}; -use crate::RpcEnvironment; +use crate::api::schema::{self, ObjectSchema, Schema}; +use crate::api::RpcEnvironment; /// A synchronous API handler gets a json Value as input and returns a json Value as output. /// @@ -18,7 +18,7 @@ use crate::RpcEnvironment; /// ``` /// # use failure::*; /// # use serde_json::{json, Value}; -/// # use proxmox_api::{*, schema::*}; +/// # use proxmox::api::{*, schema::*}; /// # /// fn hello( /// param: Value, @@ -44,7 +44,7 @@ pub type ApiHandlerFn = &'static (dyn Fn(Value, &ApiMethod, &mut dyn RpcEnvironm /// ``` /// # use failure::*; /// # use serde_json::{json, Value}; -/// # use proxmox_api::{*, schema::*}; +/// # use proxmox::api::{*, schema::*}; /// # /// use futures::*; /// @@ -77,7 +77,7 @@ pub type ApiFuture<'a> = Pin { - $crate::ApiMethod::new( - &$crate::ApiHandler::Sync( & |_, _, _| { + $crate::api::ApiMethod::new( + &$crate::api::ApiHandler::Sync( & |_, _, _| { let index = ::serde_json::json!( $map.iter().map(|s| ::serde_json::json!({ "subdir": s.0})) .collect::>() ); Ok(index) }), - &$crate::schema::ObjectSchema::new("Directory index.", &[]).additional_properties(true) + &$crate::api::schema::ObjectSchema::new("Directory index.", &[]) + .additional_properties(true) ) } } @@ -213,7 +214,7 @@ macro_rules! list_subdirs_api_method { ///``` /// # use failure::*; /// # use serde_json::{json, Value}; -/// # use proxmox_api::{*, schema::*}; +/// # use proxmox::api::{*, schema::*}; /// # /// const API_METHOD_HELLO: ApiMethod = ApiMethod::new( /// &ApiHandler::Sync(&|_, _, _| { diff --git a/proxmox-api/src/rpc_environment.rs b/proxmox/src/api/rpc_environment.rs similarity index 97% rename from proxmox-api/src/rpc_environment.rs rename to proxmox/src/api/rpc_environment.rs index 2587e334..3eabc042 100644 --- a/proxmox-api/src/rpc_environment.rs +++ b/proxmox/src/api/rpc_environment.rs @@ -1,4 +1,4 @@ -use proxmox_tools::AsAny; +use crate::tools::AsAny; use serde_json::Value; diff --git a/proxmox-api/src/schema.rs b/proxmox/src/api/schema.rs similarity index 99% rename from proxmox-api/src/schema.rs rename to proxmox/src/api/schema.rs index df0a0cab..35e16d39 100644 --- a/proxmox-api/src/schema.rs +++ b/proxmox/src/api/schema.rs @@ -10,7 +10,7 @@ use failure::*; use serde_json::{json, Value}; use url::form_urlencoded; -use crate::const_regex::ConstRegexPattern; +use crate::api::const_regex::ConstRegexPattern; /// Error type for schema validation /// @@ -466,7 +466,7 @@ impl ObjectSchema { /// `schema()` method to convert them into a `Schema`. /// /// ``` -/// # use proxmox_api::{*, schema::*}; +/// # use proxmox::api::{*, schema::*}; /// # /// const SIMPLE_OBJECT: Schema = ObjectSchema::new( /// "A very simple object with 2 properties", @@ -511,7 +511,7 @@ pub enum Schema { /// Simple list all possible values. /// /// ``` -/// # use proxmox_api::{*, schema::*}; +/// # use proxmox::api::{*, schema::*}; /// const format: ApiStringFormat = ApiStringFormat::Enum(&["vm", "ct"]); /// ``` /// @@ -520,7 +520,8 @@ pub enum Schema { /// Use a regular expression to describe valid strings. /// /// ``` -/// # use proxmox_api::{*, schema::*}; +/// # use proxmox::api::{*, schema::*}; +/// # use proxmox::const_regex; /// const_regex! { /// pub SHA256_HEX_REGEX = r"^[a-f0-9]{64}$"; /// } @@ -541,7 +542,7 @@ pub enum Schema { /// of simple data types, and objects with simple properties. /// /// ``` -/// # use proxmox_api::{*, schema::*}; +/// # use proxmox::api::{*, schema::*}; /// # /// const PRODUCT_LIST_SCHEMA: Schema = /// ArraySchema::new("Product List.", &IntegerSchema::new("Product ID").schema()) diff --git a/proxmox/src/lib.rs b/proxmox/src/lib.rs index 1248a299..c71cc705 100644 --- a/proxmox/src/lib.rs +++ b/proxmox/src/lib.rs @@ -1,19 +1,16 @@ -pub use proxmox_sys as sys; -pub use proxmox_tools as tools; +//! Proxmox "tools" package containing some generic tools along with the schema, API and CLI +//! helpers. -// Both `proxmox_api` and the 2 macros from `proxmox_api_macro` should be -// exposed via `proxmox::api`. -pub mod api { - pub use proxmox_api::*; - #[cfg(feature = "api-macro")] - pub use proxmox_api_macro::{api, router}; +pub mod api; +pub mod sys; +pub mod tools; + +/// An identity (nop) macro. Used by the `#[sortable]` proc macro. +#[cfg(feature = "sortable-macro")] +#[macro_export] +macro_rules! identity { + ($($any:tt)*) => ($($any)*) } -#[cfg(feature = "sortable-macro")] -pub use proxmox_tools::identity; - -#[cfg(feature = "sortable-macro")] -pub use proxmox_sortable_macro as sortable_macro; - #[cfg(feature = "sortable-macro")] pub use proxmox_sortable_macro::sortable; diff --git a/proxmox-sys/src/error.rs b/proxmox/src/sys/error.rs similarity index 97% rename from proxmox-sys/src/error.rs rename to proxmox/src/sys/error.rs index 3a265a32..381fe62e 100644 --- a/proxmox-sys/src/error.rs +++ b/proxmox/src/sys/error.rs @@ -36,7 +36,7 @@ pub fn io_err_other(e: E) -> io::Error { /// # use failure::{bail, Error}; /// use nix::{dir::Dir, fcntl::OFlag, sys::stat::Mode}; /// -/// use proxmox_sys::error::SysError; +/// use proxmox::sys::error::SysError; /// /// # fn test() -> Result<(), Error> { /// @@ -116,7 +116,7 @@ impl SysError for nix::Error { /// # use std::os::unix::io::RawFd; /// # use failure::{bail, Error}; /// -/// use proxmox_sys::error::SysResult; +/// use proxmox::sys::error::SysResult; /// /// struct MyReader(RawFd); /// @@ -150,7 +150,7 @@ macro_rules! other_error { #[inline] fn into_io_result(self) -> io::Result { - self.map_err($crate::error::io_err_other) + self.map_err($crate::sys::error::io_err_other) } } }; diff --git a/proxmox-sys/src/linux.rs b/proxmox/src/sys/linux.rs similarity index 91% rename from proxmox-sys/src/linux.rs rename to proxmox/src/sys/linux.rs index bd65f741..02a54f2f 100644 --- a/proxmox-sys/src/linux.rs +++ b/proxmox/src/sys/linux.rs @@ -1,7 +1,6 @@ //! Linux specific helpers and syscall wrapper use failure::*; -use proxmox_tools as tools; pub mod magic; pub mod pid; @@ -9,7 +8,7 @@ pub mod procfs; /// Get pseudo random data (/dev/urandom) pub fn random_data(size: usize) -> Result, Error> { - let mut buffer = tools::vec::undefined(size); + let mut buffer = crate::tools::vec::undefined(size); fill_with_random_data(&mut buffer)?; Ok(buffer) diff --git a/proxmox-sys/src/linux/magic.rs b/proxmox/src/sys/linux/magic.rs similarity index 100% rename from proxmox-sys/src/linux/magic.rs rename to proxmox/src/sys/linux/magic.rs diff --git a/proxmox-sys/src/linux/pid.rs b/proxmox/src/sys/linux/pid.rs similarity index 97% rename from proxmox-sys/src/linux/pid.rs rename to proxmox/src/sys/linux/pid.rs index b6edef2a..534a3c28 100644 --- a/proxmox-sys/src/linux/pid.rs +++ b/proxmox/src/sys/linux/pid.rs @@ -11,10 +11,10 @@ use nix::sys::stat::Mode; use nix::unistd::Pid; use nix::NixPath; -use crate::error::{io_err_other, SysResult}; -use crate::linux::procfs::{MountInfo, PidStat}; +use crate::sys::error::{io_err_other, SysResult}; +use crate::sys::linux::procfs::{MountInfo, PidStat}; +use crate::tools::fd::Fd; use crate::{c_result, c_str, c_try}; -use proxmox_tools::fd::Fd; /// asm-generic pidfd_open syscall number #[allow(non_upper_case_globals)] diff --git a/proxmox-sys/src/linux/procfs.rs b/proxmox/src/sys/linux/procfs.rs similarity index 99% rename from proxmox-sys/src/linux/procfs.rs rename to proxmox/src/sys/linux/procfs.rs index 065acba0..505671e6 100644 --- a/proxmox-sys/src/linux/procfs.rs +++ b/proxmox/src/sys/linux/procfs.rs @@ -12,8 +12,8 @@ use lazy_static::lazy_static; use libc; use nix::unistd::Pid; -use proxmox_tools::fs::file_read_firstline; -use proxmox_tools::parse::hex_nibble; +use crate::tools::fs::file_read_firstline; +use crate::tools::parse::hex_nibble; pub mod mountinfo; #[doc(inline)] diff --git a/proxmox-sys/src/linux/procfs/mountinfo.rs b/proxmox/src/sys/linux/procfs/mountinfo.rs similarity index 100% rename from proxmox-sys/src/linux/procfs/mountinfo.rs rename to proxmox/src/sys/linux/procfs/mountinfo.rs diff --git a/proxmox-sys/src/macros.rs b/proxmox/src/sys/macros.rs similarity index 100% rename from proxmox-sys/src/macros.rs rename to proxmox/src/sys/macros.rs diff --git a/proxmox-sys/src/lib.rs b/proxmox/src/sys/mod.rs similarity index 100% rename from proxmox-sys/src/lib.rs rename to proxmox/src/sys/mod.rs diff --git a/proxmox-tools/src/as_any.rs b/proxmox/src/tools/as_any.rs similarity index 100% rename from proxmox-tools/src/as_any.rs rename to proxmox/src/tools/as_any.rs diff --git a/proxmox-tools/src/borrow.rs b/proxmox/src/tools/borrow.rs similarity index 100% rename from proxmox-tools/src/borrow.rs rename to proxmox/src/tools/borrow.rs diff --git a/proxmox-tools/src/common_regex.rs b/proxmox/src/tools/common_regex.rs similarity index 100% rename from proxmox-tools/src/common_regex.rs rename to proxmox/src/tools/common_regex.rs diff --git a/proxmox-tools/src/fd.rs b/proxmox/src/tools/fd.rs similarity index 100% rename from proxmox-tools/src/fd.rs rename to proxmox/src/tools/fd.rs diff --git a/proxmox-tools/src/fs.rs b/proxmox/src/tools/fs.rs similarity index 99% rename from proxmox-tools/src/fs.rs rename to proxmox/src/tools/fs.rs index 4b50e075..cb3a37db 100644 --- a/proxmox-tools/src/fs.rs +++ b/proxmox/src/tools/fs.rs @@ -13,7 +13,7 @@ use nix::sys::stat; use nix::unistd::{self, Gid, Uid}; use serde_json::Value; -use crate::fd::Fd; +use crate::tools::fd::Fd; use crate::try_block; /// Read the entire contents of a file into a bytes vector @@ -241,7 +241,7 @@ pub fn create_dir>(path: P, options: CreateOptions) -> Result<(), /// ```no_run /// # use nix::sys::stat::Mode; /// # use nix::unistd::{Gid, Uid}; -/// # use proxmox_tools::fs::{create_path, CreateOptions}; +/// # use proxmox::tools::fs::{create_path, CreateOptions}; /// # fn code() -> Result<(), failure::Error> { /// create_path( /// "/var/lib/mytool/wwwdata", diff --git a/proxmox-tools/src/io.rs b/proxmox/src/tools/io.rs similarity index 100% rename from proxmox-tools/src/io.rs rename to proxmox/src/tools/io.rs diff --git a/proxmox-tools/src/io/read.rs b/proxmox/src/tools/io/read.rs similarity index 99% rename from proxmox-tools/src/io/read.rs rename to proxmox/src/tools/io/read.rs index c23cd0ad..734296a8 100644 --- a/proxmox-tools/src/io/read.rs +++ b/proxmox/src/tools/io/read.rs @@ -5,7 +5,7 @@ use std::mem; use endian_trait::Endian; -use crate::vec::{self, ByteVecExt}; +use crate::tools::vec::{self, ByteVecExt}; /// Adds some additional related functionality for types implementing [`Read`](std::io::Read). /// diff --git a/proxmox-tools/src/io/write.rs b/proxmox/src/tools/io/write.rs similarity index 100% rename from proxmox-tools/src/io/write.rs rename to proxmox/src/tools/io/write.rs diff --git a/proxmox-tools/src/lib.rs b/proxmox/src/tools/mod.rs similarity index 93% rename from proxmox-tools/src/lib.rs rename to proxmox/src/tools/mod.rs index 96309c6a..55afd662 100644 --- a/proxmox-tools/src/lib.rs +++ b/proxmox/src/tools/mod.rs @@ -20,12 +20,6 @@ pub use uuid::Uuid; #[doc(inline)] pub use as_any::AsAny; -/// An identity (nop) macro. Used by the `#[sortable]` proc macro. -#[macro_export] -macro_rules! identity { - ($($any:tt)*) => ($($any)*) -} - /// Evaluates to the offset (in bytes) of a given member within a struct #[macro_export] macro_rules! offsetof { @@ -38,7 +32,7 @@ macro_rules! offsetof { /// /// This should compile: /// ``` -/// # use proxmox_tools::static_assert_size; +/// # use proxmox::static_assert_size; /// #[repr(C)] /// struct Stuff { /// value: [u8; 32] @@ -48,7 +42,7 @@ macro_rules! offsetof { /// /// This should fail to compile: /// ```compile_fail -/// # use proxmox_tools::static_assert_size; +/// # use proxmox::static_assert_size; /// #[repr(C)] /// struct Stuff { /// value: [u8; 32] @@ -68,7 +62,7 @@ macro_rules! static_assert_size { /// /// #### Example: /// ``` -/// # use proxmox_tools::try_block; +/// # use proxmox::try_block; /// # use failure::*; /// # let some_condition = false; /// let result = try_block!({ @@ -94,7 +88,7 @@ pub fn digest_to_hex(digest: &[u8]) -> String { /// Convert a byte slice to a string of hexadecimal digits. /// /// ``` -/// # use proxmox_tools::bin_to_hex; +/// # use proxmox::tools::bin_to_hex; /// /// let text = bin_to_hex(&[1, 2, 0xff]); /// assert_eq!(text, "0102ff"); @@ -116,7 +110,7 @@ pub fn bin_to_hex(digest: &[u8]) -> String { /// digits. /// /// ``` -/// # use proxmox_tools::hex_to_bin; +/// # use proxmox::tools::hex_to_bin; /// /// let data = hex_to_bin("aabb0123").unwrap(); /// assert_eq!(&data, &[0xaa, 0xbb, 0x01, 0x23]); diff --git a/proxmox-tools/src/parse.rs b/proxmox/src/tools/parse.rs similarity index 100% rename from proxmox-tools/src/parse.rs rename to proxmox/src/tools/parse.rs diff --git a/proxmox-tools/src/serde.rs b/proxmox/src/tools/serde.rs similarity index 93% rename from proxmox-tools/src/serde.rs rename to proxmox/src/tools/serde.rs index 24c96a08..c71af31c 100644 --- a/proxmox-tools/src/serde.rs +++ b/proxmox/src/tools/serde.rs @@ -4,8 +4,7 @@ /// /// Usage example: /// ``` -/// # pub extern crate proxmox_tools; -/// # mod proxmox { pub use proxmox_tools as tools; } +/// # use proxmox::tools; /// /// use chrono::{DateTime, TimeZone, Utc}; /// use serde::{Deserialize, Serialize}; @@ -57,9 +56,6 @@ pub mod date_time_as_rfc3339 { /// /// Usage example: /// ``` -/// # pub extern crate proxmox_tools; -/// # mod proxmox { pub use proxmox_tools as tools; } -/// /// use serde::{Deserialize, Serialize}; /// /// # #[derive(Debug)] diff --git a/proxmox-tools/src/uuid.rs b/proxmox/src/tools/uuid.rs similarity index 97% rename from proxmox-tools/src/uuid.rs rename to proxmox/src/tools/uuid.rs index d836b0a6..4c93f408 100644 --- a/proxmox-tools/src/uuid.rs +++ b/proxmox/src/tools/uuid.rs @@ -5,7 +5,7 @@ use std::fmt; use failure::{bail, Error}; -use crate::parse::hex_nibble; +use crate::tools::parse::hex_nibble; #[link(name = "uuid")] extern "C" { @@ -17,7 +17,7 @@ extern "C" { /// Uuid generated with the system's native libuuid. /// /// ``` -/// use proxmox_tools::uuid::Uuid; +/// use proxmox::tools::uuid::Uuid; /// /// let uuid = Uuid::generate(); /// println!("Generated uuid: {}", uuid); @@ -57,7 +57,7 @@ impl Uuid { /// Parse a uuid in optionally-hyphenated format. /// /// ``` - /// use proxmox_tools::uuid::Uuid; + /// use proxmox::tools::uuid::Uuid; /// /// let gen = Uuid::generate(); /// let text = format!("{}", gen); diff --git a/proxmox-tools/src/vec.rs b/proxmox/src/tools/vec.rs similarity index 98% rename from proxmox-tools/src/vec.rs rename to proxmox/src/tools/vec.rs index b82a905f..a74f62be 100644 --- a/proxmox-tools/src/vec.rs +++ b/proxmox/src/tools/vec.rs @@ -13,7 +13,7 @@ //! //! This module provides some helpers for this kind of code. Many of these are supposed to stay on //! a lower level, with I/O helpers for types implementing [`Read`](std::io::Read) being available -//! in the [`tools::io`](crate::io) module. +//! in the [`tools::io`](crate::tools::io) module. //! //! Examples: //! ```no_run diff --git a/proxmox-tools/src/vec/byte_vec.rs b/proxmox/src/tools/vec/byte_vec.rs similarity index 100% rename from proxmox-tools/src/vec/byte_vec.rs rename to proxmox/src/tools/vec/byte_vec.rs