pub struct LeaseView {
pub pid: u32,
pub url: Option<String>,
pub started_at: String,
pub executable: Option<ExecutableIdentity>,
pub version: Option<String>,
}Expand description
A lease as a reader sees it: what the server wrote about itself, without the token that makes the file the server’s own.
use majordomus_cli::capability::builtin::server::LeaseView;
let view = LeaseView { pid: 7, url: Some("http://127.0.0.1:8741".into()),
started_at: "2026-09-10T00:00:00Z".into(), executable: None, version: Some("1.0.0".into()) };
let v = serde_json::to_value(&view).unwrap();
assert_eq!(v["pid"], 7);
assert!(v.get("token").is_none() && v.get("root").is_none());Fields§
§pid: u32The server’s process id. Not proof of a live server — only a probe that is answered
is — but decisions are made from it: a live pid earns a server that does not answer
the election’s busy wait before its lease is taken over, and serve ensure’s patience
before it starts another; serve stop sends its SIGTERM to this pid.
url: Option<String>The address, once bound.
started_at: StringWhen the server took the lease, RFC 3339.
executable: Option<ExecutableIdentity>The executable the server was started from, when it could be located.
version: Option<String>The executable’s version; absent for a server too old to have written one.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LeaseView
impl<'de> Deserialize<'de> for LeaseView
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for LeaseView
Source§impl JsonSchema for LeaseView
impl JsonSchema for LeaseView
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for LeaseView
Auto Trait Implementations§
impl Freeze for LeaseView
impl RefUnwindSafe for LeaseView
impl Send for LeaseView
impl Sync for LeaseView
impl Unpin for LeaseView
impl UnsafeUnpin for LeaseView
impl UnwindSafe for LeaseView
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.