pub struct TicketStore { /* private fields */ }Expand description
Wraps a Session and exposes a ticket-shaped API on top of it.
Implementations§
Source§impl TicketStore
impl TicketStore
Sourcepub fn discover() -> Result<Self>
pub fn discover() -> Result<Self>
Open a store for the git repo discovered from the current working directory.
Sourcepub fn open(repo: Repository) -> Result<Self>
pub fn open(repo: Repository) -> Result<Self>
Open a store for an already-loaded gix::Repository (used in tests
and by host applications that own the repo handle).
Sourcepub fn from_session(session: Session) -> Result<Self>
pub fn from_session(session: Session) -> Result<Self>
Open a store from an already-built session (lets callers preconfigure
e.g. with_timestamp for deterministic tests).
Sourcepub fn create(&self, title: &str, opts: NewTicketOpts) -> Result<Ticket>
pub fn create(&self, title: &str, opts: NewTicketOpts) -> Result<Ticket>
Create a new ticket. Returns the freshly-loaded ticket.
Sourcepub fn list(&self) -> Result<Vec<Ticket>>
pub fn list(&self) -> Result<Vec<Ticket>>
Load every ticket in the project in a single round-trip.
Sourcepub fn resolve_id(&self, reference: &str) -> Result<Uuid>
pub fn resolve_id(&self, reference: &str) -> Result<Uuid>
Resolve a user-supplied ticket reference (full UUID or unique prefix, hyphens optional, case-insensitive) into a real UUID.
pub fn set_title(&self, id: &Uuid, title: &str) -> Result<()>
pub fn set_description( &self, id: &Uuid, description: Option<&str>, ) -> Result<()>
pub fn set_spec(&self, id: &Uuid, spec: Option<&str>) -> Result<()>
pub fn set_state(&self, id: &Uuid, state: TicketState) -> Result<()>
pub fn set_lifecycle( &self, id: &Uuid, status: TicketStatus, state: TicketState, ) -> Result<()>
pub fn set_closed_by(&self, id: &Uuid, who: Option<&str>) -> Result<()>
pub fn set_assigned(&self, id: &Uuid, who: Option<&str>) -> Result<()>
pub fn set_priority(&self, id: &Uuid, priority: Option<i64>) -> Result<()>
pub fn set_points(&self, id: &Uuid, points: Option<i64>) -> Result<()>
pub fn set_milestone(&self, id: &Uuid, milestone: Option<&str>) -> Result<()>
pub fn set_code(&self, id: &Uuid, code: Option<&str>) -> Result<()>
Sourcepub fn set_parent(&self, child_id: &Uuid, parent_id: &Uuid) -> Result<()>
pub fn set_parent(&self, child_id: &Uuid, parent_id: &Uuid) -> Result<()>
Set the parent of a ticket. Validates that the parent exists and prevents self-reference and circular chains.
Sourcepub fn clear_parent(&self, child_id: &Uuid) -> Result<()>
pub fn clear_parent(&self, child_id: &Uuid) -> Result<()>
Remove the parent of a ticket.
Sourcepub fn delete_ticket(&self, id: &Uuid) -> Result<()>
pub fn delete_ticket(&self, id: &Uuid) -> Result<()>
Delete a ticket and remove parent/child relationship references.
Sourcepub fn add_dependency(&self, id: &Uuid, dependency_id: &Uuid) -> Result<()>
pub fn add_dependency(&self, id: &Uuid, dependency_id: &Uuid) -> Result<()>
Add a dependency: id depends on dependency_id.
The dependency ticket must exist. Circular dependencies are rejected.
Sourcepub fn remove_dependency(&self, id: &Uuid, dependency_id: &Uuid) -> Result<()>
pub fn remove_dependency(&self, id: &Uuid, dependency_id: &Uuid) -> Result<()>
Remove a dependency: id no longer depends on dependency_id.
pub fn set_meta(&self, id: &Uuid, field: &str, value: &str) -> Result<()>
pub fn add_tag(&self, id: &Uuid, tag: &str) -> Result<()>
pub fn remove_tag(&self, id: &Uuid, tag: &str) -> Result<()>
pub fn add_writeup_tag(&self, id: &Uuid, tag: &str) -> Result<()>
pub fn remove_writeup_tag(&self, id: &Uuid, tag: &str) -> Result<()>
pub fn add_comment(&self, id: &Uuid, body: &str) -> Result<()>
pub fn create_writeup( &self, title: &str, opts: NewWriteupOpts, ) -> Result<Writeup>
pub fn list_writeups(&self) -> Result<Vec<Writeup>>
pub fn load_writeup(&self, id: &Uuid) -> Result<Writeup>
pub fn resolve_writeup_id(&self, reference: &str) -> Result<Uuid>
pub fn append_writeup_version(&self, id: &Uuid, body: &str) -> Result<()>
pub fn set_writeup_title(&self, id: &Uuid, title: &str) -> Result<()>
pub fn set_writeup_status(&self, id: &Uuid, status: WriteupStatus) -> Result<()>
pub fn set_writeup_priority( &self, id: &Uuid, priority: Option<i64>, ) -> Result<()>
pub fn link_writeup_ticket( &self, writeup_id: &Uuid, ticket_id: &Uuid, ) -> Result<()>
pub fn unlink_writeup_ticket( &self, writeup_id: &Uuid, ticket_id: &Uuid, ) -> Result<()>
pub fn promote_writeup(&self, writeup_id: &Uuid) -> Result<Ticket>
Sourcepub fn save_view(&self, name: &str, ids: &BTreeSet<Uuid>) -> Result<()>
pub fn save_view(&self, name: &str, ids: &BTreeSet<Uuid>) -> Result<()>
Save a snapshot of ids under the name name.
Replaces any existing membership of that view.
Sourcepub fn load_view(&self, name: &str) -> Result<BTreeSet<Uuid>>
pub fn load_view(&self, name: &str) -> Result<BTreeSet<Uuid>>
Load the UUID set stored under view name.
Sourcepub fn list_views(&self) -> Result<Vec<String>>
pub fn list_views(&self) -> Result<Vec<String>>
List all view names defined on this project, alphabetised.
pub fn add_owner(&self, who: &str) -> Result<()>
pub fn remove_owner(&self, who: &str) -> Result<()>
pub fn list_owners(&self) -> Result<BTreeSet<String>>
Sourcepub fn list_users(&self) -> Result<BTreeMap<String, BTreeSet<String>>>
pub fn list_users(&self) -> Result<BTreeMap<String, BTreeSet<String>>>
List all user nicks and their email sets.
Sourcepub fn add_user_email(&self, nick: &str, email: &str) -> Result<()>
pub fn add_user_email(&self, nick: &str, email: &str) -> Result<()>
Add an email to a nick’s set.
Sourcepub fn remove_user_email(&self, nick: &str, email: &str) -> Result<()>
pub fn remove_user_email(&self, nick: &str, email: &str) -> Result<()>
Remove an email from a nick’s set. If the set becomes empty, remove the key.
Sourcepub fn remove_user(&self, nick: &str) -> Result<()>
pub fn remove_user(&self, nick: &str) -> Result<()>
Remove a user nick entirely (all emails).
Sourcepub fn resolve_user(&self, input: &str) -> Result<String>
pub fn resolve_user(&self, input: &str) -> Result<String>
Resolve a nick or email to an email address.
If input contains @, treat it as an email and return as-is.
Otherwise, look up as a nick and return the first email.
Sourcepub fn nick_for_email(&self, email: &str) -> Result<Option<String>>
pub fn nick_for_email(&self, email: &str) -> Result<Option<String>>
Reverse-lookup: given an email, find the nick (if any).