pub struct NoteDef {
pub deck: String,
pub model: String,
pub fields: HashMap<String, String>,
pub tags: Vec<String>,
pub guid: Option<String>,
pub note_id: Option<i64>,
}Expand description
Note definition.
Fields§
§deck: StringDeck name to add note to.
model: StringModel name for this note.
fields: HashMap<String, String>Field values.
Tags for this note.
guid: Option<String>Custom GUID (auto-generated if not specified).
note_id: Option<i64>Anki note ID (assigned after sync, used for tracking).
Implementations§
Source§impl NoteDef
impl NoteDef
Sourcepub fn fields_ordered(&self, model: &ModelDef) -> Vec<String>
pub fn fields_ordered(&self, model: &ModelDef) -> Vec<String>
Get field values in model field order.
Get tags as a space-separated string with surrounding spaces.
Sourcepub fn fields_as_html(
&self,
markdown_fields: &[String],
) -> HashMap<String, String>
pub fn fields_as_html( &self, markdown_fields: &[String], ) -> HashMap<String, String>
Get fields with markdown converted to HTML for specified fields.
Returns a new HashMap with markdown fields converted to HTML.
Sourcepub fn convert_html_to_markdown(&mut self, markdown_fields: &[String])
pub fn convert_html_to_markdown(&mut self, markdown_fields: &[String])
Convert HTML to markdown in specified fields (mutates in place).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NoteDef
impl<'de> Deserialize<'de> for NoteDef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for NoteDef
impl Freeze for NoteDef
impl RefUnwindSafe for NoteDef
impl Send for NoteDef
impl Sync for NoteDef
impl Unpin for NoteDef
impl UnsafeUnpin for NoteDef
impl UnwindSafe for NoteDef
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