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: RankBacklog 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: StringImplementations§
Source§impl BacklogItem
impl BacklogItem
Sourcepub fn new(
id: ItemId,
title: impl Into<String>,
status: Status,
rank: Rank,
now: DateTime<Utc>,
) -> Result<Self>
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.
Sourcepub fn backlog_cmp(&self, other: &Self) -> Ordering
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.
Sourcepub fn link_commit(&mut self, sha: impl Into<String>) -> bool
pub fn link_commit(&mut self, sha: impl Into<String>) -> bool
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.
Sourcepub fn unlink_commit(&mut self, sha: &str) -> bool
pub fn unlink_commit(&mut self, sha: &str) -> bool
Remove related commit sha (true if removed, false if not).
Sourcepub fn transition_to(
&mut self,
to: Status,
workflow: &Workflow,
now: DateTime<Utc>,
) -> Result<()>
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
nowinstart_at. Entering the last column directly also starts the work, including in a single-column workflow. - On every entry to the last column, record
nowindone_at; clear it when leaving that column.
Trait Implementations§
Source§impl Clone for BacklogItem
impl Clone for BacklogItem
Source§fn clone(&self) -> BacklogItem
fn clone(&self) -> BacklogItem
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 BacklogItem
impl Debug for BacklogItem
impl Eq for BacklogItem
Source§impl PartialEq for BacklogItem
impl PartialEq for BacklogItem
impl StructuralPartialEq for BacklogItem
Auto Trait Implementations§
impl Freeze for BacklogItem
impl RefUnwindSafe for BacklogItem
impl Send for BacklogItem
impl Sync for BacklogItem
impl Unpin for BacklogItem
impl UnsafeUnpin for BacklogItem
impl UnwindSafe for BacklogItem
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<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