pub struct RevisionPoint {
pub period: String,
pub up_count: u32,
pub down_count: u32,
}Expand description
A flexible data point for revision counts over different time periods.
This struct allows any provider to represent revision data for any time period, making the system provider-agnostic instead of tied to specific hardcoded buckets.
Fields§
§period: StringThe period this data point represents (e.g., “7d”, “1mo”, “3mo”). This allows providers to use their own time period conventions.
up_count: u32Number of upward revisions in this period.
down_count: u32Number of downward revisions in this period.
Implementations§
Source§impl RevisionPoint
impl RevisionPoint
Sourcepub fn new(period: impl Into<String>, up_count: u32, down_count: u32) -> Self
pub fn new(period: impl Into<String>, up_count: u32, down_count: u32) -> Self
Creates a new revision point with the specified period and counts.
Sourcepub const fn total_revisions(&self) -> u32
pub const fn total_revisions(&self) -> u32
Returns the total number of revisions (up + down) in this period.
Sourcepub const fn net_revisions(&self) -> i32
pub const fn net_revisions(&self) -> i32
Returns the net revision count (up - down) in this period. Positive values indicate more upward revisions, negative values indicate more downward revisions.
Trait Implementations§
Source§impl Clone for RevisionPoint
impl Clone for RevisionPoint
Source§fn clone(&self) -> RevisionPoint
fn clone(&self) -> RevisionPoint
Returns a duplicate of the value. Read more
1.0.0 · 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 RevisionPoint
impl Debug for RevisionPoint
Source§impl<'de> Deserialize<'de> for RevisionPoint
impl<'de> Deserialize<'de> for RevisionPoint
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
Source§impl PartialEq for RevisionPoint
impl PartialEq for RevisionPoint
Source§impl Serialize for RevisionPoint
impl Serialize for RevisionPoint
impl Eq for RevisionPoint
impl StructuralPartialEq for RevisionPoint
Auto Trait Implementations§
impl Freeze for RevisionPoint
impl RefUnwindSafe for RevisionPoint
impl Send for RevisionPoint
impl Sync for RevisionPoint
impl Unpin for RevisionPoint
impl UnwindSafe for RevisionPoint
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