Struct starry::UserObs[][src]

pub struct UserObs {
    pub user_id: UserId,
    pub time: DateTime<Utc>,
    pub counts: Vec<RepoObs>,
}

a user observation is what’s stored as a file in database. There’s one per (user, time) and it contains the counts of stars of all repos of that user on that time.

Fields

user_id: UserIdtime: DateTime<Utc>counts: Vec<RepoObs>

Implementations

impl UserObs[src]

pub fn write_in_dir(&self, user_dir: &Path) -> Result<()>[src]

pub fn filename_date(path: &Path) -> Option<DateTime<Utc>>[src]

if the file has a name matching the userobs filename format (date.csv), then returns this date

pub fn read_file(
    file_path: &Path,
    user_id: UserId,
    time: DateTime<Utc>
) -> Result<Self>
[src]

pub fn read_line(file_path: &Path, repo_name: &str) -> Result<Option<RepoObs>>[src]

pub fn read_lines_and_sum(
    file_path: &Path,
    repo_names: &[&str]
) -> Result<(Vec<Option<usize>>, usize)>
[src]

pub fn sum(&self) -> DatedObs[src]

pub fn repo_count(&self, repo_name: &str) -> Option<usize>[src]

pub fn diff_from(&self, old_uo: &Self) -> Vec<RepoChange>[src]

Trait Implementations

impl Debug for UserObs[src]

impl From<UserObs> for List[src]

Auto Trait Implementations

impl RefUnwindSafe for UserObs

impl Send for UserObs

impl Sync for UserObs

impl Unpin for UserObs

impl UnwindSafe for UserObs

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.