Wolfgang Bumiller
c38d18484d
api: move ApiMethod from router to top level
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 13:43:10 +01:00
Wolfgang Bumiller
c0266a17cd
move HttpError to separate error module
...
the router doesn't actually use it
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 13:38:57 +01:00
Wolfgang Bumiller
2577effaf7
api: schema: avoid an extra temp string
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 13:32:42 +01:00
Wolfgang Bumiller
b489c2ceeb
import the new api definitions
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 13:30:28 +01:00
Wolfgang Bumiller
068d56ed3d
delete the old api macro stuff
...
to be replaced by a new set of macros for the current api
schema in proxmox-backup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 13:13:18 +01:00
Wolfgang Bumiller
7f4d223a4a
rename sorted-data to proxmox-sortable_macro
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 13:10:37 +01:00
Wolfgang Bumiller
297aca53f7
proxmox: add sortable-macro feature
...
Use:
# Cargo.toml:
[dependencies]
proxmox = { version = "0.1", features = [ "sortable-macro" ] }
# file.rs
use proxmox::{sortable, identity};
#[sortable]
const DATA: &[u8; 4] = sorted!([3, 4, 1, 2]);
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 11:04:13 +01:00
Wolfgang Bumiller
ceb3ff5544
import sorted-data proc macro
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 11:04:13 +01:00
Wolfgang Bumiller
729fed5eac
tools: add identity macro
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 10:24:27 +01:00
Wolfgang Bumiller
3cc4bcd78e
tools: uuid: don't use uuid_parse
...
The manpage states that it requires a terminating null byte.
We don't have that. Also, the uuid crate also accepted
non-hyphenated hex strings, so we do that as well.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-14 10:13:08 +01:00
Wolfgang Bumiller
6cf330c9d2
add tools::parse submodule, move hex_nibble to it
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-14 09:59:04 +01:00
Wolfgang Bumiller
85a9752ea2
tools: uuid: fix doc comments
...
(at least use the correct format)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-14 09:48:08 +01:00
Wolfgang Bumiller
b53b621cd8
add Uuid replacement
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-13 14:49:11 +01:00
Wolfgang Bumiller
db83a675f0
sys: get rid of Regex dependency
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-13 14:49:11 +01:00
Wolfgang Bumiller
b294fb1314
sys: add read_proc_pid_stat test
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-13 14:49:11 +01:00
Dietmar Maurer
1ae66863d1
update toolchain to stable
2019-11-08 11:51:21 +01:00
Dietmar Maurer
3172a01ce1
set toolchain to beta
2019-10-12 14:09:43 +02:00
Wolfgang Bumiller
ddea357de2
work around a compiler bug
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-10-04 14:12:21 +02:00
Wolfgang Bumiller
589cb7e296
macro: enforce Send
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-10-04 14:11:33 +02:00
Wolfgang Bumiller
df55ab2dda
api-macro: update to 1.0 of syn/quote/proc_macro2
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-10-04 13:42:03 +02:00
Wolfgang Bumiller
e0b50d07bf
cleanup
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-28 10:36:43 +02:00
Wolfgang Bumiller
617e25abba
api: make ApiMethodInfo already require Send + Sync
...
ApiMethodInfo provides static information about a type
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-28 10:30:33 +02:00
Wolfgang Bumiller
eb4e28d7bf
remove async_await feature gate
...
then we can build with beta as well
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-28 10:10:06 +02:00
Wolfgang Bumiller
01de528fc3
fixups for new hyper alpha
...
Body's Streawm impl was put behind the 'unstable-stream'
feature, so we won't be using it for now.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-28 09:58:04 +02:00
Wolfgang Bumiller
29893d66ae
put api macro crate behind 'api-macro' feature
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-28 09:54:39 +02:00
Wolfgang Bumiller
fd03b808ab
tools: io::read: introduce read_host_value_boxed
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-11 14:40:42 +02:00
Wolfgang Bumiller
e692e69e14
remove Cargo.lock as we currently have no git dependencies
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-11 09:26:00 +02:00
Wolfgang Bumiller
7864cef16d
update hyper & tokio to alpha releases
...
tokio: alpha.2 to alpha.4
hyper: git alpha.0 to crates.io alpha.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-06 10:13:32 +02:00
Wolfgang Bumiller
4e14a09551
cargo update
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@errno.eu>
2019-08-23 16:47:53 +02:00
Wolfgang Bumiller
5c5db5ccc1
tools: tests for static_assert_size macro
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@errno.eu>
2019-08-23 16:47:27 +02:00
Wolfgang Bumiller
f1351e7e41
tools: add a static size assertion
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-23 11:26:57 +02:00
Wolfgang Bumiller
e1ebf9b67e
tools: borrow: use ManuallyDrop
...
While Option serves a similar purpose, ManuallyDrop is an
api more directed at what we're actually doing here.
Note that Option<Box<>> is sort of guaranteed to have the
same layout as Box<> mostly due to the fact that Box<>
cannot be null, whereas ManuallyDrop is always guaranteed to
be the same layout as the inner type.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:53:40 +02:00
Wolfgang Bumiller
ec1448cd29
[clippy] api: mostly noise reduction
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:45:39 +02:00
Wolfgang Bumiller
09d84f6634
[clippy] tools: lifetimes and constants
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:42:05 +02:00
Wolfgang Bumiller
a11f6e88f8
[clippy] sys: simplifications and optimizations
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:28:44 +02:00
Wolfgang Bumiller
05b432c422
[clippy] macro: remaining clippy lints
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:24:37 +02:00
Wolfgang Bumiller
c241be9e6a
[clippy] macro: ident implements comparsion with strings
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:20:49 +02:00
Wolfgang Bumiller
7f2ae4f272
[clippy] api-test: remove unnecessary lifetimes
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:15:03 +02:00
Wolfgang Bumiller
d06b2b277c
[clippy] api-test: remaining changes to memory.rs
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:09:41 +02:00
Wolfgang Bumiller
c6e022523b
[clippy] api-test: more int by value passing
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:07:07 +02:00
Wolfgang Bumiller
dffed98348
[clippy] api-test: simplify some loops
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:04:57 +02:00
Wolfgang Bumiller
adf6727072
[clippy] api-test: generalize HashSet impls and closure cleanups
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:04:55 +02:00
Wolfgang Bumiller
4a33af4387
[clippy]: api-test: fix unsuffixed memory values
...
Clippy actually noticed that the else branch was the same as
the one for the 'b' suffix...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-21 16:59:19 +02:00
Wolfgang Bumiller
27f954f632
[clippy] api-test: use trailing zeros, pattern efficiency
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-21 16:56:22 +02:00
Wolfgang Bumiller
2551fe4a74
[clippy] api-test: pass Copy integer by value
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-21 16:53:19 +02:00
Wolfgang Bumiller
45b5839e7e
replace std::mem::uninitialized
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-21 16:49:12 +02:00
Wolfgang Bumiller
e59456e0b7
tools: fs: rename CreateOptions::empty to new
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-21 12:01:43 +02:00
Wolfgang Bumiller
47fdbc6a32
tools: fs: add create_path and CreateOptions
...
To allow creating paths recursively with options. (Basically
extends `std::fs::create_dir_all`.)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-21 11:51:45 +02:00
Wolfgang Bumiller
aadb47a292
update nix to 0.15 for mkdirat
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-21 11:51:45 +02:00
Wolfgang Bumiller
4a1c914827
tools: fd: improve drop handler and add some helpers
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-21 11:51:45 +02:00