pub struct UsageSnapshot {
pub device_id: String,
pub client_version: String,
pub rows: Vec<UsageRow>,
}Fields§
§device_id: String§client_version: String§rows: Vec<UsageRow>Implementations§
Source§impl UsageSnapshot
impl UsageSnapshot
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Rejects snapshots that cannot be stored at all: an unusable device id or too many rows.
Sourcepub fn accepted_rows(&self, today: NaiveDate) -> (Vec<UsageRow>, usize)
pub fn accepted_rows(&self, today: NaiveDate) -> (Vec<UsageRow>, usize)
The rows worth storing, and how many were dropped: one bad row (an odd skill
name, a day outside the last MAX_DAY_AGE days) must not cost the rest.
Trait Implementations§
Source§impl Clone for UsageSnapshot
impl Clone for UsageSnapshot
Source§impl Debug for UsageSnapshot
impl Debug for UsageSnapshot
Source§impl<'de> Deserialize<'de> for UsageSnapshot
impl<'de> Deserialize<'de> for UsageSnapshot
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 UsageSnapshot
Source§impl PartialEq for UsageSnapshot
impl PartialEq for UsageSnapshot
Source§impl Serialize for UsageSnapshot
impl Serialize for UsageSnapshot
impl StructuralPartialEq for UsageSnapshot
Auto Trait Implementations§
impl Freeze for UsageSnapshot
impl RefUnwindSafe for UsageSnapshot
impl Send for UsageSnapshot
impl Sync for UsageSnapshot
impl Unpin for UsageSnapshot
impl UnsafeUnpin for UsageSnapshot
impl UnwindSafe for UsageSnapshot
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