pub struct Heatmap {
pub contribution_weeks: Vec<ContributionWeek>,
}Expand description
A Heatmap instance represents a fully scraped and parsed Github
constribution heatmap.
A Heatmap is constructed from a reference to a parsed HTML document
corresponding to a Github profile.
Fields§
§contribution_weeks: Vec<ContributionWeek>A vector of ContributionWeek instances spanning across the entire
year of contributions.
Implementations§
Source§impl Heatmap
impl Heatmap
Sourcepub fn from_document(document: &Html) -> Result<Self, HeatmapError>
pub fn from_document(document: &Html) -> Result<Self, HeatmapError>
Constructs a new Heatmap instance from a parsed HTML document.
Provided reference to HTML document corresponds to the markup of a
Github profile page (e.g. https://github.com/torvalds).
ContributionWeek instances will be constructed and pushed to the
contribution_weeks vector for as many columns are evident in the parsed
markup.
§Errors
HeatmapError::QueryElementfails to query Heatmap SVG element.HeatmapError::QueryElementfails to query Heatmap node elements
See ContributionWeek for errors related to constructing ContributionWeek
instances.
§Panics
A panic will occur in the unlikely event that Selector::parse fails to parse
CSS selector constants.
Sourcepub fn render(&self, color: &ColorValues)
pub fn render(&self, color: &ColorValues)
Generates visual representation of Heatmap data structure, and writes it to standard output.
Resulting Unicode will have a fill color depending on provided
ColorValues color variant.
Trait Implementations§
impl Eq for Heatmap
impl StructuralPartialEq for Heatmap
Auto Trait Implementations§
impl Freeze for Heatmap
impl RefUnwindSafe for Heatmap
impl Send for Heatmap
impl Sync for Heatmap
impl Unpin for Heatmap
impl UnwindSafe for Heatmap
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.