pub struct ContributionWeek {
pub contributions: Vec<Option<Contribution>>,
}Expand description
A ContributionWeek instance represents an entire week of contributions
in a Github contribution heatmap. Typically visible as a column of heatmap
nodes on a Github profile page.
ContributionWeek instances are typically not constructed explicitly, rather created
implicitly by the higher level Heatmap struct via the from_days associated method.
Fields§
§contributions: Vec<Option<Contribution>>A vector of Contribution instances belonging to the week.
Contributions are wrapped in an Option, as years won’t necessarily begin and/or end on a Sunday, meaning that certain days may not be included in the heatmap during any given week.
Implementations§
Source§impl ContributionWeek
impl ContributionWeek
Sourcepub fn from_days(days: &Vec<ElementRef<'_>>) -> Result<Self, HeatmapError>
pub fn from_days(days: &Vec<ElementRef<'_>>) -> Result<Self, HeatmapError>
Contructs a new ContributionWeek instance from a vector of HTML elements.
Provided vector corresponds to a collection of Github heatmap nodes.
For each valid day of the week with contributions, a Contribution instance
will be constructed and pushed to the contributions vector.
§Errors
HeatmapError::QueryAttributefails to query y attributeHeatmapError::ParseAttributefails to parse y attributeHeatmapError::UnknownNodeFormatencounters unexpected heatmap node size while determining day of week for contributions
See Contribution for possible errors related to constructing a [‘Contribution’].
Trait Implementations§
Source§impl Debug for ContributionWeek
impl Debug for ContributionWeek
Source§impl PartialEq for ContributionWeek
impl PartialEq for ContributionWeek
impl Eq for ContributionWeek
impl StructuralPartialEq for ContributionWeek
Auto Trait Implementations§
impl Freeze for ContributionWeek
impl RefUnwindSafe for ContributionWeek
impl Send for ContributionWeek
impl Sync for ContributionWeek
impl Unpin for ContributionWeek
impl UnwindSafe for ContributionWeek
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.