[][src]Struct mdbook_cat_prep::cat_context::CatContext

pub struct CatContext {
    pub teacher_cards: Vec<TeacherCard>,
    pub teachers: Vec<Teacher>,
    pub subject_cards: Vec<SubjectCard>,
    pub subjects: Vec<Subject>,
    pub article_cards: Vec<ArticleCard>,
    pub articles: Vec<Article>,
    pub tags: HashMap<String, Vec<ArticleCard>>,
}

Cat kontext

Typ obsahující kompletní kotext cat-prepu. Jednotlivé struktury obsahují spoustu redundance, za účelem jednoduchého vyhledávání potřebných informací. Nedoporučuje se tedy tento instance tohoto typu po vytvoření mutovat, protože redudantní kopie jednotlivých objektů si mohou přestat vzájemně odpovídat

Fields

teacher_cards: Vec<TeacherCard>

obsahuje karty jednotlivých kantorů

teachers: Vec<Teacher>

profily vyučujících

subject_cards: Vec<SubjectCard>

karty předmětů

subjects: Vec<Subject>

předměty

article_cards: Vec<ArticleCard>

karty článků

articles: Vec<Article>

články

tags: HashMap<String, Vec<ArticleCard>>

obsahuje hashmapu tagů

tagy jsou sesbírány z jednotlivých článků, jako hodnoty pak figurují články, které mají daný tag přidělený

při renderování je tato hashmapa zkonvertována na typ TagContext, který je prakticky newtype pattern na typu Vec<(String, Vec<ArticleCard>)>.

TagContext je následně využit jako šablonový kontext pro generování stránky s tagy.

Methods

impl CatContext[src]

pub fn new() -> CatContext[src]

vygeneruje prázdný CatContext. Užitečné pro generování umělého kontextu

pub fn with_book(src: &mut Book) -> Result<CatContext, CatError>[src]

vygeneruje kontext dle knihy. Tato funkce knihuju mutuje, protože odděluje headery od obsahu jednotlivých souborů

Trait Implementations

impl Clone for CatContext[src]

impl Debug for CatContext[src]

impl<'de> Deserialize<'de> for CatContext[src]

impl Serialize for CatContext[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,