Struct speki_backend::card::SavedCard
source · pub struct SavedCard { /* private fields */ }Expand description
Represents a card that has been saved as a toml file, which is basically anywhere in the codebase except for when youre constructing a new card. Don’t save this in containers or pass to functions, rather use the Id, and get new instances of SavedCard from the cache. Also, every time you mutate it, call the persist() method.
Implementations§
source§impl SavedCard
impl SavedCard
pub fn print(&self) -> String
pub fn set_priority(&mut self, priority: Priority)
pub fn priority(&self) -> &Priority
pub fn expected_gain(&self) -> Option<f32>
pub fn get_info(&self, cache: &mut CardCache) -> Option<CardInfo>
pub fn reviews(&self) -> &Vec<Review>
pub fn raw_reviews(&self) -> &Reviews
pub fn new(card: Card, location: CardLocation, last_modified: Duration) -> Self
pub fn get_unfinished_dependent_qty(&self, cache: &mut CardCache) -> usize
pub fn last_modified(&self) -> Duration
pub fn category(&self) -> &Category
pub fn front_text(&self) -> &str
pub fn is_pending(&self) -> bool
pub fn is_suspended(&self) -> bool
pub fn is_finished(&self) -> bool
pub fn set_front_text(&mut self, text: &str)
pub fn set_back_text(&mut self, text: &str)
sourcepub fn merge_with(&mut self, cache: &mut CardCache, other_card: Id)
pub fn merge_with(&mut self, cache: &mut CardCache, other_card: Id)
If you accidentally made two identical cards, this will merge the stuff like depencies, reviews etc.. and delete the other card
pub fn stability(&self) -> Option<Duration>
pub fn recall_rate(&self) -> Option<f32>
sourcepub fn recall_rate_sortable(&self) -> Option<u32>
pub fn recall_rate_sortable(&self) -> Option<u32>
dumb lol no internet will fix later
pub fn trad_recall_rate_at_time(&self, time: Duration) -> Option<f32>
pub fn strength(&self) -> Option<Duration>
pub fn time_since_last_review(&self) -> Option<Duration>
pub fn back_text(&self) -> &str
pub fn contains_tag(&self, tag: &str) -> bool
pub fn id(&self) -> Id
pub fn dependent_ids(&self) -> &BTreeSet<Id>
pub fn dependency_ids(&self) -> &BTreeSet<Id>
pub fn set_suspended(&mut self, suspended: IsSuspended)
pub fn set_finished(&mut self, finished: bool)
pub fn insert_tag(&mut self, tag: String)
pub fn check_cycle( cache: &mut CardCache, id: Id, is_dependent: bool ) -> Option<Vec<Id>>
pub fn set_dependency( &mut self, id: Id, cache: &mut CardCache ) -> Option<String>
pub fn set_dependent(&mut self, id: Id, cache: &mut CardCache) -> Option<String>
sourcepub fn _insert_dependency_raw(
dependent_id: &Id,
dependency_id: &Id,
insertion_id: &Id,
cache: &mut CardCache
)
pub fn _insert_dependency_raw( dependent_id: &Id, dependency_id: &Id, insertion_id: &Id, cache: &mut CardCache )
a = span means foo b = change span desc by.. inserted: c = what is a span desc?
pub fn remove_dependency(&mut self, id: &Id, _cache: &mut CardCache)
pub fn remove_dependent(&mut self, id: &Id, _cache: &mut CardCache)
pub fn as_path(&self) -> PathBuf
pub fn pending_filter(card: Id, cache: &mut CardCache) -> bool
pub fn random_filter(card: Id, cache: &mut CardCache) -> bool
pub fn unfinished_filter(card: Id, cache: &mut CardCache) -> bool
pub fn review_filter(card: Id, cache: &mut CardCache) -> bool
sourcepub fn is_outdated(&self) -> bool
pub fn is_outdated(&self) -> bool
Checks if corresponding file has been modified after this type got deserialized from the file.
pub fn is_resolved(&self, cache: &mut CardCache) -> bool
sourcepub fn is_confidently_resolved(&self, cache: &mut CardCache) -> bool
pub fn is_confidently_resolved(&self, cache: &mut CardCache) -> bool
Checks that its dependencies are not only marked finished, but they’re also strong memories.
sourcepub fn move_card(self, destination: &Category, cache: &mut CardCache) -> Self
pub fn move_card(self, destination: &Category, cache: &mut CardCache) -> Self
Moves card by deleting it and then creating it again in a new location warning: will refresh file name
pub fn get_review_type(&self) -> ReviewType
pub fn delete(self, cache: &mut CardCache)
pub fn get_cards_from_category_recursively( category: &Category ) -> HashSet<SavedCard>
pub fn search_in_cards<'a>( input: &'a str, cards: &'a HashSet<SavedCard>, excluded_cards: &'a HashSet<Id> ) -> Vec<&'a SavedCard>
pub fn from_id(id: &Id) -> Option<Self>
pub fn load_all_cards() -> HashSet<SavedCard>
pub fn edit_with_vim(&self) -> Self
pub fn from_path(path: &Path) -> Self
pub fn into_card(self) -> Card
pub fn new_review(&mut self, grade: Grade, time: Duration)
pub fn fake_new_review( &mut self, grade: Grade, time: Duration, at_time: Duration )
pub fn lapses(&self) -> u32
Trait Implementations§
source§impl Ord for SavedCard
impl Ord for SavedCard
source§impl PartialEq for SavedCard
impl PartialEq for SavedCard
source§impl PartialOrd for SavedCard
impl PartialOrd for SavedCard
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moreimpl Eq for SavedCard
impl StructuralEq for SavedCard
impl StructuralPartialEq for SavedCard
Auto Trait Implementations§
impl RefUnwindSafe for SavedCard
impl Send for SavedCard
impl Sync for SavedCard
impl Unpin for SavedCard
impl UnwindSafe for SavedCard
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.