Skip to main content

BacklogItem

Struct BacklogItem 

Source
pub struct BacklogItem {
Show 16 fields pub id: ItemId, pub title: String, pub status: Status, pub rank: Rank, pub points: Option<u32>, pub labels: Vec<String>, pub assignee: Option<String>, pub sprint: Option<String>, pub parent: Option<ItemId>, pub depends_on: Vec<ItemId>, pub start_at: Option<DateTime<Utc>>, pub done_at: Option<DateTime<Utc>>, pub commits: Vec<String>, pub created: DateTime<Utc>, pub updated: DateTime<Utc>, pub body: String,
}
Expand description

Product Backlog Item (PBI).

Fields§

§id: ItemId§title: String§status: Status§rank: Rank

Backlog sort order; lexicographically smaller ranks have higher priority.

§points: Option<u32>§labels: Vec<String>§assignee: Option<String>§sprint: Option<String>§parent: Option<ItemId>

Parent PBI. Parent-child links are kept acyclic, forming a tree hierarchy.

This represents a hierarchy such as epic → story → task; the model does not assign a type such as epic or story. Cycles are rejected by crate::backlog::parent_creates_cycle.

§depends_on: Vec<ItemId>

PBIs that this item depends on and that should be completed first.

Dependencies are independent of the parent-child hierarchy. Cycles are allowed but undesirable; callers can detect them with crate::backlog::dependency_creates_cycle.

§start_at: Option<DateTime<Utc>>

Time when work first started, recorded when the item leaves the first workflow column.

Record it once on the first transition out of the first column and retain it when the item is reopened. It is None when work has not started.

§done_at: Option<DateTime<Utc>>

Time when the item most recently entered the completion column.

Update it on every entry to the last column and clear it when the item leaves that column. It is None when the item is not complete.

§commits: Vec<String>

Git commit SHAs associated with this PBI, in insertion order without duplicates.

These are plain-text links and do not require Git to be installed. link stores the supplied string; scan discovers SHAs from commit messages containing the item ID.

§created: DateTime<Utc>§updated: DateTime<Utc>§body: String

Implementations§

Source§

impl BacklogItem

Source

pub fn new( id: ItemId, title: impl Into<String>, status: Status, rank: Rank, now: DateTime<Utc>, ) -> Result<Self>

Create a minimally configured PBI with default points, labels, and relationships.

The caller supplies the backlog Rank. Return Error::EmptyTitle if title is empty.

Source

pub fn backlog_cmp(&self, other: &Self) -> Ordering

Canonical backlog order shared by every view (list, board, kanban).

Ascending rank first, then a deterministic (prefix, number) tie-break so items with equal ranks never reorder between views (a stable sort on this comparator preserves that order). This is the single source of truth for “default” ordering; column-level overrides (e.g. the terminal column’s done_at sort) layer on top of it.

Add related commit sha; return true when it was added.

Trim leading and trailing whitespace, ignore blank values, reject duplicates, and preserve insertion order so git diff remains stable.

Remove related commit sha (true if removed, false if not).

Source

pub fn transition_to( &mut self, to: Status, workflow: &Workflow, now: DateTime<Utc>, ) -> Result<()>

Transition the state to to and update updated and working time (start_at / done_at).

If to is not in the workflow, return Error::UnknownStatus without changing the item.

Determine work timestamps from column position rather than column names, because workflows can be renamed:

  • On the first transition out of the first column, record now in start_at. Entering the last column directly also starts the work, including in a single-column workflow.
  • On every entry to the last column, record now in done_at; clear it when leaving that column.

Trait Implementations§

Source§

impl Clone for BacklogItem

Source§

fn clone(&self) -> BacklogItem

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BacklogItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for BacklogItem

Source§

impl PartialEq for BacklogItem

Source§

fn eq(&self, other: &BacklogItem) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BacklogItem

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> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.