Skip to main content

Clock

Struct Clock 

Source
pub struct Clock { /* private fields */ }
Expand description

The collective’s activity clock: its sessions in the order they first appear in the outcome log (by first ms, then id: independent of line order). Only the kinds the team shares (outcome.rs SHARED_KINDS) tick it, so every node counts the same sessions from the same first ms: a session that only graded never moves it, and neither does a tested result (about the session’s work).

Implementations§

Source§

impl Clock

Source

pub fn of(outcomes: &[Outcome]) -> Self

Source

pub fn eligible(&self, c: &Challenge) -> Option<Vec<u64>>

The ticks of the sessions c counts its disuse in, ascending, or None for every tick: a repo convention’s are the sessions with a line in its repo, matched ignoring case as reach.rs deliverable does or, in the team view, by its exact tag; any other reach’s are all of them.

Source

pub fn now(&self, session: Option<&str>) -> u64

The tick of session: its place on the clock, or the next tick for a session not in the log (or none given).

Source

pub fn of_session(&self, session: &str) -> u64

The tick of a session.

Source

pub fn at_ms(&self, ms: i64) -> u64

The tick at wall time ms: how many sessions had started before it.

Trait Implementations§

Source§

impl Debug for Clock

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Clock

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Clock

§

impl RefUnwindSafe for Clock

§

impl Send for Clock

§

impl Sync for Clock

§

impl Unpin for Clock

§

impl UnsafeUnpin for Clock

§

impl UnwindSafe for Clock

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.