pub struct KnowledgeIndex {
pub schema_version: String,
pub last_updated: Option<DateTime<Utc>>,
pub articles: Vec<KnowledgeIndexEntry>,
pub next_number: u64,
pub use_timestamp_numbering: bool,
}Expand description
Knowledge base index (knowledge.yaml)
Fields§
§schema_version: StringSchema version
last_updated: Option<DateTime<Utc>>Last update timestamp
articles: Vec<KnowledgeIndexEntry>List of articles
next_number: u64Next available article number (for sequential numbering)
use_timestamp_numbering: boolWhether to use timestamp-based numbering (YYMMDDHHmm format)
Implementations§
Source§impl KnowledgeIndex
impl KnowledgeIndex
Sourcepub fn new_with_timestamp_numbering() -> Self
pub fn new_with_timestamp_numbering() -> Self
Create a new knowledge index with timestamp-based numbering
Sourcepub fn add_article(&mut self, article: &KnowledgeArticle, filename: String)
pub fn add_article(&mut self, article: &KnowledgeArticle, filename: String)
Add an article to the index
Sourcepub fn get_next_number(&self) -> u64
pub fn get_next_number(&self) -> u64
Get the next available article number For timestamp-based numbering, generates a new timestamp For sequential numbering, returns the next sequential number
Sourcepub fn find_by_number(&self, number: u64) -> Option<&KnowledgeIndexEntry>
pub fn find_by_number(&self, number: u64) -> Option<&KnowledgeIndexEntry>
Find an article by number
Trait Implementations§
Source§impl Clone for KnowledgeIndex
impl Clone for KnowledgeIndex
Source§fn clone(&self) -> KnowledgeIndex
fn clone(&self) -> KnowledgeIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KnowledgeIndex
impl Debug for KnowledgeIndex
Source§impl Default for KnowledgeIndex
impl Default for KnowledgeIndex
Source§impl<'de> Deserialize<'de> for KnowledgeIndex
impl<'de> Deserialize<'de> for KnowledgeIndex
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
Source§impl PartialEq for KnowledgeIndex
impl PartialEq for KnowledgeIndex
Source§impl Serialize for KnowledgeIndex
impl Serialize for KnowledgeIndex
impl StructuralPartialEq for KnowledgeIndex
Auto Trait Implementations§
impl Freeze for KnowledgeIndex
impl RefUnwindSafe for KnowledgeIndex
impl Send for KnowledgeIndex
impl Sync for KnowledgeIndex
impl Unpin for KnowledgeIndex
impl UnwindSafe for KnowledgeIndex
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