pub struct IssueIndex {
pub next: u64,
pub labels: Option<Vec<Label>>,
pub issues: BTreeMap<u64, IssueEntry>,
}Expand description
The issue index for one repo.
Fields§
§next: u64Next number to allocate.
labels: Option<Vec<Label>>Repo labels, materialised on first write (Phase 5).
issues: BTreeMap<u64, IssueEntry>Issues keyed by number.
Implementations§
Source§impl IssueIndex
impl IssueIndex
Sourcepub fn allocate(&mut self, entry: IssueEntry) -> u64
pub fn allocate(&mut self, entry: IssueEntry) -> u64
Allocate the next issue number, appending entry (its number
field is overwritten with the allocated value). Returns the number.
Sourcepub fn by_state(&self, state: IssueState) -> Vec<&IssueEntry>
pub fn by_state(&self, state: IssueState) -> Vec<&IssueEntry>
Issues filtered by state, newest-number first.
Sourcepub fn count(&self, state: IssueState) -> usize
pub fn count(&self, state: IssueState) -> usize
Count of issues in state.
Sourcepub fn set_state(&mut self, number: u64, state: IssueState) -> bool
pub fn set_state(&mut self, number: u64, state: IssueState) -> bool
Mutate an issue’s state, returning true if it existed.
Trait Implementations§
Source§impl Clone for IssueIndex
impl Clone for IssueIndex
Source§fn clone(&self) -> IssueIndex
fn clone(&self) -> IssueIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IssueIndex
impl Debug for IssueIndex
Source§impl Default for IssueIndex
impl Default for IssueIndex
Source§impl<'de> Deserialize<'de> for IssueIndex
impl<'de> Deserialize<'de> for IssueIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for IssueIndex
Source§impl PartialEq for IssueIndex
impl PartialEq for IssueIndex
Source§impl Serialize for IssueIndex
impl Serialize for IssueIndex
impl StructuralPartialEq for IssueIndex
Auto Trait Implementations§
impl Freeze for IssueIndex
impl RefUnwindSafe for IssueIndex
impl Send for IssueIndex
impl Sync for IssueIndex
impl Unpin for IssueIndex
impl UnsafeUnpin for IssueIndex
impl UnwindSafe for IssueIndex
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
Mutably borrows from an owned value. Read more