pub struct JsonWorktree {
pub name: String,
pub id: String,
pub path: String,
pub branch: Option<String>,
pub head: Option<String>,
pub is_main: bool,
pub is_locked: bool,
pub is_prunable: bool,
pub status: JsonStatus,
pub age_seconds: Option<u64>,
pub issue: Option<u64>,
pub pr: Option<u64>,
}Expand description
One worktree as exposed to scripting / editor integrations. Mirrors
the columns of gwm list plus the machine-only fields a consumer
needs (absolute path, raw age_seconds, linked issue/PR numbers).
Fields§
§name: StringDisplay name — the basename of the worktree directory.
id: StringInternal git worktree id (.git/worktrees/<id>); diverges from
name after a git worktree move.
path: StringAbsolute path to the worktree working directory.
branch: Option<String>§head: Option<String>Full HEAD commit oid (40-char hex), when resolvable. A machine consumer gets the exact oid for comparison; truncate client-side if a short form is wanted.
is_main: bool§is_locked: bool§is_prunable: bool§status: JsonStatus§age_seconds: Option<u64>Branch age relative to the trunk baseline, in whole seconds.
null for trunk branches and unresolvable repos.
issue: Option<u64>Linked issue number (branch-name inferred or explicit), if any.
pr: Option<u64>Linked PR number (inferred, explicit, or auto-detected), if any.
Trait Implementations§
Source§impl Clone for JsonWorktree
impl Clone for JsonWorktree
Source§fn clone(&self) -> JsonWorktree
fn clone(&self) -> JsonWorktree
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JsonWorktree
impl Debug for JsonWorktree
Source§impl<'de> Deserialize<'de> for JsonWorktree
impl<'de> Deserialize<'de> for JsonWorktree
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 JsonWorktree
Source§impl From<&WorktreeInfo> for JsonWorktree
impl From<&WorktreeInfo> for JsonWorktree
Source§fn from(w: &WorktreeInfo) -> Self
fn from(w: &WorktreeInfo) -> Self
Source§impl PartialEq for JsonWorktree
impl PartialEq for JsonWorktree
Source§fn eq(&self, other: &JsonWorktree) -> bool
fn eq(&self, other: &JsonWorktree) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for JsonWorktree
impl Serialize for JsonWorktree
impl StructuralPartialEq for JsonWorktree
Auto Trait Implementations§
impl Freeze for JsonWorktree
impl RefUnwindSafe for JsonWorktree
impl Send for JsonWorktree
impl Sync for JsonWorktree
impl Unpin for JsonWorktree
impl UnsafeUnpin for JsonWorktree
impl UnwindSafe for JsonWorktree
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
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>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more