[][src]Struct supermemo2::Item

pub struct Item { /* fields omitted */ }

A struct that holds the essential metadata for an item using the supermemo2 algorithm.

Methods

impl Item[src]

pub fn new(repetitions: usize, efactor: f64) -> Self[src]

Return an Item with the given number of repetitions and E-factor.

pub fn repetitions(&self) -> usize[src]

Get the number of repetitions of this Item.

pub fn efactor(&self) -> f64[src]

Get the E-factor of this Item.

pub fn interval(&self) -> usize[src]

Returns the current interval of the Item. The interval is defined as the time in days since the previous review after which this Item will be due for review.

pub fn review(&self, quality: u8) -> Result<Self, Error>[src]

Returns a new Item based on the given quality. The quality can be an integer between 0 and 5. If a quality above 5 is given, this will return an Err.

  • 0 - complete blackout.
  • 1 - incorrect response; the correct one remembered
  • 2 - incorrect response; where the correct one seemed easy to recall
  • 3 - correct response recalled with serious difficulty
  • 4 - correct response after a hesitation
  • 5 - perfect response

Trait Implementations

impl Clone for Item[src]

impl Copy for Item[src]

impl Debug for Item[src]

impl Default for Item[src]

fn default() -> Self[src]

Return a default new Item with 0 repetitions and an E-factor of 2.5.

Auto Trait Implementations

impl RefUnwindSafe for Item

impl Send for Item

impl Sync for Item

impl Unpin for Item

impl UnwindSafe for Item

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.