pub struct StarSnapshot { /* private fields */ }Implementations§
Source§impl StarSnapshot
impl StarSnapshot
Sourcepub fn from_calendar_html(
document: &Html,
year: usize,
unlocked_days: usize,
synced_at_unix_seconds: u64,
) -> Result<Self, CalendarHtmlError>
pub fn from_calendar_html( document: &Html, year: usize, unlocked_days: usize, synced_at_unix_seconds: u64, ) -> Result<Self, CalendarHtmlError>
Builds a snapshot from a signed-in edition calendar.
unlocked_days is the expected number of unlocked days at sync time.
§Errors
Returns an error if authentication or calendar coverage cannot be established, or if the resulting snapshot is invalid.
Source§impl StarSnapshot
impl StarSnapshot
Sourcepub fn new(
year: usize,
synced_at_unix_seconds: u64,
stars_by_day: Vec<u8>,
) -> Result<Self, StarStoreError>
pub fn new( year: usize, synced_at_unix_seconds: u64, stars_by_day: Vec<u8>, ) -> Result<Self, StarStoreError>
Creates a snapshot for consecutive days starting with day one.
§Errors
Returns an error if the edition or star counts are invalid.
pub fn synced_at_unix_seconds(&self) -> u64
pub fn star(&self, day: usize, part: u8) -> VerifiedStar
Trait Implementations§
Source§impl Debug for StarSnapshot
impl Debug for StarSnapshot
Source§impl<'de> Deserialize<'de> for StarSnapshot
impl<'de> Deserialize<'de> for StarSnapshot
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 StarSnapshot
Source§impl PartialEq for StarSnapshot
impl PartialEq for StarSnapshot
Source§impl Serialize for StarSnapshot
impl Serialize for StarSnapshot
impl StructuralPartialEq for StarSnapshot
Auto Trait Implementations§
impl Forget for StarSnapshot
impl Freeze for StarSnapshot
impl Move for StarSnapshot
impl RefUnwindSafe for StarSnapshot
impl Send for StarSnapshotwhere
RawVecInner: Send,
impl Sync for StarSnapshotwhere
RawVecInner: Sync,
impl Unpin for StarSnapshot
impl UnsafeUnpin for StarSnapshot
impl UnwindSafe for StarSnapshotwhere
RawVecInner: UnwindSafe,
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Compare self to
key and return true if they are equal.