1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Deadlines, from C.
//!
//! [`crate::helpers::sync`] holds two pieces: taking a mutex the way this
//! crate takes one, which has no meaning outside Rust, and reading the
//! timeouts the [`Limits`] fields describe, which does. What a timeout in
//! seconds means — when it arms a deadline at all, and how long that deadline
//! is — crosses here, so a caller filling in a [`Limits`] reads the same rules
//! the crate does.
//!
//! [`Limits`]: crate::models::Limits
//!
//! [`Lock`] has no counterpart here: it hands back a guard, which is a Rust
//! lifetime and nothing a C caller could hold.
//!
//! [`Lock`]: crate::helpers::sync::Lock
/// Whether a timeout in seconds asks for a deadline at all.
///
/// Zero, negative and non-finite values all disable the timeout, which is what
/// the [`Limits`] fields are documented to do.
///
/// [`Limits`]: crate::models::Limits
pub extern "C"
/// How long a timeout in seconds is, in nanoseconds, or `-1` when it arms no
/// deadline.
///
/// A value too large to hold saturates rather than wrapping.
pub extern "C"
/// How an elapsed deadline reads, as [`Elapsed`] renders it.
///
/// Owned by the caller, and freed with `soyokaze_buffer_free`.
///
/// [`Elapsed`]: crate::helpers::sync::Elapsed
pub extern "C"
/// The status an elapsed deadline is reported as.
///
/// Always [`Status::Timeout`], since [`Elapsed`] converts to [`Error::Timeout`]
/// and nothing else.
///
/// [`Status::Timeout`]: crate::ffi::Status::Timeout
/// [`Elapsed`]: crate::helpers::sync::Elapsed
/// [`Error::Timeout`]: crate::errors::Error::Timeout
pub extern "C"