pub struct ServerPolicy {
pub probe_timeout_seconds: Option<u64>,
pub bind_grace_seconds: Option<u64>,
pub join_timeout_seconds: Option<u64>,
pub busy_grace_seconds: Option<u64>,
pub read_deadline_seconds: Option<u64>,
pub idle_seconds: Option<u64>,
}Expand description
server: — what a lease contest is judged by.
Every field is optional and absent means “keep the compiled default”, which is why there
is no reader-side default value here: the defaults live in one place, lease::Timings,
and this block only says which of them this repository overrides.
use majordomus_cli::policy::ServerPolicy;
// a policy that predates the block: absent, not defaulted to zero
assert_eq!(ServerPolicy::default().probe_timeout_seconds, None);
let p: ServerPolicy =
serde_json::from_str(r#"{"probe_timeout_seconds": 5}"#).expect("a server block");
assert_eq!(p.probe_timeout_seconds, Some(5));Fields§
§probe_timeout_seconds: Option<u64>server.probe_timeout_seconds: — how long a probe waits for the current owner before
that silence counts as evidence that it is gone.
bind_grace_seconds: Option<u64>server.bind_grace_seconds: — how long a lease naming no URL yet is left alone,
because a server writes its lease before it can serve.
join_timeout_seconds: Option<u64>server.join_timeout_seconds: — how long a process waits to join or create the lease
file before refusing rather than waiting forever.
busy_grace_seconds: Option<u64>server.busy_grace_seconds: — how long a live owner that does not answer is waited
on, and asked again, before its lease is taken over.
read_deadline_seconds: Option<u64>server.read_deadline_seconds: — how long the shared server lets a connection go
without a request read in full on it before it closes the connection.
idle_seconds: Option<u64>server.idle_seconds: — how long a server started for a checkout no client owns
(serve ensure, a shell entering the checkout) outlives its last peer before it stops
by itself. --idle on the command line overrides it.
Trait Implementations§
Source§impl Clone for ServerPolicy
impl Clone for ServerPolicy
Source§fn clone(&self) -> ServerPolicy
fn clone(&self) -> ServerPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ServerPolicy
Source§impl Debug for ServerPolicy
impl Debug for ServerPolicy
Source§impl Default for ServerPolicy
impl Default for ServerPolicy
Source§fn default() -> ServerPolicy
fn default() -> ServerPolicy
Source§impl<'de> Deserialize<'de> for ServerPolicy
impl<'de> Deserialize<'de> for ServerPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ServerPolicy
Source§impl PartialEq for ServerPolicy
impl PartialEq for ServerPolicy
Source§fn eq(&self, other: &ServerPolicy) -> bool
fn eq(&self, other: &ServerPolicy) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ServerPolicy
Auto Trait Implementations§
impl Freeze for ServerPolicy
impl RefUnwindSafe for ServerPolicy
impl Send for ServerPolicy
impl Sync for ServerPolicy
impl Unpin for ServerPolicy
impl UnsafeUnpin for ServerPolicy
impl UnwindSafe for ServerPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.