pub struct Card {
pub card: String,
pub fields: BTreeMap<String, String>,
}Expand description
One slot of the text blob: {"card": "...", "fields": {name: text}}.
Fields§
§card: String§fields: BTreeMap<String, String>Implementations§
Source§impl Card
impl Card
Sourcepub fn parse(text: &str) -> Result<Self, String>
pub fn parse(text: &str) -> Result<Self, String>
The slot’s JSON object (the file validation guarantees an object;
a missing card is empty, a non-string field value is rendered as
JSON).
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
A slot the builder wrote for a language the entry does not carry
({"card": "", "fields": {}}), or a card with nothing in it.
Sourcepub fn first_sentence(&self) -> &str
pub fn first_sentence(&self) -> &str
The first sentence of the card (the name and its one-line
identity): up to the first ., ! or ? followed by whitespace
or the end, skipping a terminator that would leave fewer than
FIRST_SENTENCE_MIN chars (Hypericum perforatum L.); without
one, the card up to FIRST_SENTENCE_MAX chars at a word
boundary.
Trait Implementations§
impl Eq for Card
impl StructuralPartialEq for Card
Auto Trait Implementations§
impl Freeze for Card
impl RefUnwindSafe for Card
impl Send for Card
impl Sync for Card
impl Unpin for Card
impl UnsafeUnpin for Card
impl UnwindSafe for Card
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.