Skip to main content

TicketStore

Struct TicketStore 

Source
pub struct TicketStore { /* private fields */ }
Expand description

Wraps a Session and exposes a ticket-shaped API on top of it.

Implementations§

Source§

impl TicketStore

Source

pub fn discover() -> Result<Self>

Open a store for the git repo discovered from the current working directory.

Source

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).

Source

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).

Source

pub fn session(&self) -> &Session

Borrow the underlying git-meta session.

Source

pub fn email(&self) -> &str

The user email this store will record on writes.

Source

pub fn create(&self, title: &str, opts: NewTicketOpts) -> Result<Ticket>

Create a new ticket. Returns the freshly-loaded ticket.

Source

pub fn list(&self) -> Result<Vec<Ticket>>

Load every ticket in the project in a single round-trip.

Source

pub fn load(&self, id: &Uuid) -> Result<Ticket>

Load a single ticket by exact UUID.

Source

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.

Source

pub fn set_title(&self, id: &Uuid, title: &str) -> Result<()>

Source

pub fn set_description( &self, id: &Uuid, description: Option<&str>, ) -> Result<()>

Source

pub fn set_spec(&self, id: &Uuid, spec: Option<&str>) -> Result<()>

Source

pub fn set_state(&self, id: &Uuid, state: TicketState) -> Result<()>

Source

pub fn set_lifecycle( &self, id: &Uuid, status: TicketStatus, state: TicketState, ) -> Result<()>

Source

pub fn set_closed_by(&self, id: &Uuid, who: Option<&str>) -> Result<()>

Source

pub fn set_assigned(&self, id: &Uuid, who: Option<&str>) -> Result<()>

Source

pub fn set_priority(&self, id: &Uuid, priority: Option<i64>) -> Result<()>

Source

pub fn set_points(&self, id: &Uuid, points: Option<i64>) -> Result<()>

Source

pub fn set_milestone(&self, id: &Uuid, milestone: Option<&str>) -> Result<()>

Source

pub fn set_code(&self, id: &Uuid, code: Option<&str>) -> Result<()>

Source

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.

Source

pub fn clear_parent(&self, child_id: &Uuid) -> Result<()>

Remove the parent of a ticket.

Source

pub fn delete_ticket(&self, id: &Uuid) -> Result<()>

Delete a ticket and remove parent/child relationship references.

Source

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.

Source

pub fn remove_dependency(&self, id: &Uuid, dependency_id: &Uuid) -> Result<()>

Remove a dependency: id no longer depends on dependency_id.

Source

pub fn set_meta(&self, id: &Uuid, field: &str, value: &str) -> Result<()>

Source

pub fn add_tag(&self, id: &Uuid, tag: &str) -> Result<()>

Source

pub fn remove_tag(&self, id: &Uuid, tag: &str) -> Result<()>

Source

pub fn add_writeup_tag(&self, id: &Uuid, tag: &str) -> Result<()>

Source

pub fn remove_writeup_tag(&self, id: &Uuid, tag: &str) -> Result<()>

Source

pub fn add_comment(&self, id: &Uuid, body: &str) -> Result<()>

Source

pub fn create_writeup( &self, title: &str, opts: NewWriteupOpts, ) -> Result<Writeup>

Source

pub fn list_writeups(&self) -> Result<Vec<Writeup>>

Source

pub fn load_writeup(&self, id: &Uuid) -> Result<Writeup>

Source

pub fn resolve_writeup_id(&self, reference: &str) -> Result<Uuid>

Source

pub fn append_writeup_version(&self, id: &Uuid, body: &str) -> Result<()>

Source

pub fn set_writeup_title(&self, id: &Uuid, title: &str) -> Result<()>

Source

pub fn set_writeup_status(&self, id: &Uuid, status: WriteupStatus) -> Result<()>

Source

pub fn set_writeup_priority( &self, id: &Uuid, priority: Option<i64>, ) -> Result<()>

Source

pub fn promote_writeup(&self, writeup_id: &Uuid) -> Result<Ticket>

Source

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.

Source

pub fn load_view(&self, name: &str) -> Result<BTreeSet<Uuid>>

Load the UUID set stored under view name.

Source

pub fn list_views(&self) -> Result<Vec<String>>

List all view names defined on this project, alphabetised.

Source

pub fn add_owner(&self, who: &str) -> Result<()>

Source

pub fn remove_owner(&self, who: &str) -> Result<()>

Source

pub fn list_owners(&self) -> Result<BTreeSet<String>>

Source

pub fn list_users(&self) -> Result<BTreeMap<String, BTreeSet<String>>>

List all user nicks and their email sets.

Source

pub fn get_user(&self, nick: &str) -> Result<BTreeSet<String>>

Get the email set for a nick.

Source

pub fn add_user_email(&self, nick: &str, email: &str) -> Result<()>

Add an email to a nick’s set.

Source

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.

Source

pub fn remove_user(&self, nick: &str) -> Result<()>

Remove a user nick entirely (all emails).

Source

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.

Source

pub fn nick_for_email(&self, email: &str) -> Result<Option<String>>

Reverse-lookup: given an email, find the nick (if any).

Source

pub fn schema_version(&self) -> Result<Option<String>>

Source

pub fn serialize(&self) -> Result<()>

Source

pub fn pull(&self, remote: Option<&str>) -> Result<()>

Source

pub fn push(&self, remote: Option<&str>) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.