pub struct ServerView {
pub worktree: PathBuf,
pub branch: Option<String>,
pub checkout_id: String,
pub primary: bool,
pub this_checkout: bool,
pub standing: ServerStanding,
pub reason: Option<String>,
pub lease: Option<LeaseView>,
pub peers: Option<usize>,
}Expand description
One checkout of the repository, and the server its lease names.
use majordomus_cli::capability::builtin::server::{ServerStanding, ServerView};
let view = ServerView { worktree: "/r".into(), branch: Some("master".into()), checkout_id: "c".into(),
primary: true, this_checkout: true, standing: ServerStanding::Absent, reason: None, lease: None, peers: None };
let v = serde_json::to_value(&view).unwrap();
assert_eq!(v["standing"], "absent");
assert!(v.get("lease").is_none() && v.get("peers").is_none(), "what there is not is not written");Fields§
§worktree: PathBufThe checkout, absolute and canonical.
branch: Option<String>The branch checked out there, when git names one.
checkout_id: StringThe checkout’s identity: what its server answers as repository_id.
primary: boolWhether this is the primary checkout rather than a linked worktree.
this_checkout: boolWhether this is the checkout the answering process serves.
standing: ServerStandingWhere its server stands.
reason: Option<String>Why, when the standing is not ready: what the lease held, or what answered.
lease: Option<LeaseView>The lease, when the file holds one.
peers: Option<usize>How many peers the server reports attached, when it answers.
Trait Implementations§
Source§impl Clone for ServerView
impl Clone for ServerView
Source§fn clone(&self) -> ServerView
fn clone(&self) -> ServerView
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerView
impl Debug for ServerView
Source§impl<'de> Deserialize<'de> for ServerView
impl<'de> Deserialize<'de> for ServerView
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 ServerView
Source§impl JsonSchema for ServerView
impl JsonSchema for ServerView
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 moreSource§impl PartialEq for ServerView
impl PartialEq for ServerView
Source§fn eq(&self, other: &ServerView) -> bool
fn eq(&self, other: &ServerView) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ServerView
impl Serialize for ServerView
impl StructuralPartialEq for ServerView
Auto Trait Implementations§
impl Freeze for ServerView
impl RefUnwindSafe for ServerView
impl Send for ServerView
impl Sync for ServerView
impl Unpin for ServerView
impl UnsafeUnpin for ServerView
impl UnwindSafe for ServerView
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.