pub enum IssueRef {
GitHub {
owner: String,
repo: String,
number: u64,
},
Linear {
owner: String,
repo: String,
id: String,
},
Local {
project_path: PathBuf,
display_number: u32,
},
}Expand description
A reference to an issue that identifies a workspace.
Variants§
GitHub
A GitHub issue identified by owner, repo, and number.
Fields
Linear
A Linear issue identified by its UUID, paired with the GitHub repo that hosts the code for that project.
Fields
Local
A local Centy issue — the repository itself is the source, no remote clone needed.
Implementations§
Source§impl IssueRef
impl IssueRef
Sourcepub fn parse(s: &str) -> Result<Self>
pub fn parse(s: &str) -> Result<Self>
Parse any of the supported input formats:
https://github.com/owner/repo/issues/42worktree://open?owner=X&repo=Y&issue=42worktree://open?url=<encoded-github-url>worktree://open?owner=X&repo=Y&linear_id=<uuid>owner/repo#42owner/repo@<linear-uuid>
§Errors
Returns an error if s does not match any supported format or if the
extracted values (e.g. issue number) are invalid.
Sourcepub fn parse_with_options(s: &str) -> Result<(Self, DeepLinkOptions)>
pub fn parse_with_options(s: &str) -> Result<(Self, DeepLinkOptions)>
Like [parse] but also returns any DeepLinkOptions embedded in a
worktree:// URL (e.g. the editor query param).
§Errors
Returns an error if s cannot be parsed as a valid issue reference.
Source§impl IssueRef
impl IssueRef
Sourcepub fn temp_path(&self) -> PathBuf
pub fn temp_path(&self) -> PathBuf
Path to the worktree checkout.
For Local: ~/worktrees/local/{project_name}/issue-{display_number}
For others: ~/worktrees/github/{owner}/{repo}/issue-N
Sourcepub fn bare_clone_path(&self) -> PathBuf
pub fn bare_clone_path(&self) -> PathBuf
Path to the bare clone (or the local repo itself for Local).
§Panics
Panics if the home directory cannot be determined.
Source§impl IssueRef
impl IssueRef
Sourcepub fn workspace_dir_name(&self) -> String
pub fn workspace_dir_name(&self) -> String
Directory name used inside the bare clone for this worktree.
Sourcepub fn branch_name(&self) -> String
pub fn branch_name(&self) -> String
Git branch name for this issue worktree.
Trait Implementations§
impl Eq for IssueRef
impl StructuralPartialEq for IssueRef
Auto Trait Implementations§
impl Freeze for IssueRef
impl RefUnwindSafe for IssueRef
impl Send for IssueRef
impl Sync for IssueRef
impl Unpin for IssueRef
impl UnsafeUnpin for IssueRef
impl UnwindSafe for IssueRef
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.