[][src]Struct deadwiki::db::DB

pub struct DB { /* fields omitted */ }

Implementations

impl DB[src]

pub fn new<S: AsRef<str>>(root: S) -> DB[src]

Create a new DB object. Should only have one per run.

pub fn is_empty(&self) -> bool[src]

Is this DB empty?

pub fn len(&self) -> usize[src]

How many wiki pages have been created?

pub fn find(&self, name: &str) -> Option<Page>[src]

Find a single wiki page by name.

pub fn exists(&self, name: &str) -> bool[src]

Check if a wiki page exists by name.

pub fn pages(&self) -> Result<Vec<Page>>[src]

All the wiki pages, in alphabetical order.

pub fn names(&self) -> Result<Vec<String>>[src]

All the wiki page names, in alphabetical order.

pub fn titles(&self) -> Result<Vec<String>>[src]

All the wiki page titles, in alphabetical order.

pub fn recent(&self) -> Result<Vec<Page>>[src]

Recently modified wiki pages.

pub fn tags(&self) -> Result<Vec<String>>[src]

All the tags used, in alphabetical order.

pub fn find_pages_with_tag(&self, tag: &str) -> Result<Vec<Page>>[src]

pub fn create(&self, name: &str, body: &str) -> Result<Page>[src]

Create a new wiki page on disk. Name should be the title, such as "Linux Laptops" - it'll get converted to linux_laptops.md.

pub fn update(&self, name: &str, body: &str) -> Result<Page>[src]

Save a page to disk. Doesn't track renames, just content changes for now.

pub fn absolute_path(&self, path: &str) -> String[src]

Get an FS path to a file, without changing case or characters.

pub fn is_git(&self) -> bool[src]

Is this DB tracked with git?

pub fn title_to_name(title: &str) -> String[src]

"Keyboard Shortcut" -> "Keyboard_Shortcut"

Trait Implementations

impl Send for DB[src]

impl Sync for DB[src]

Auto Trait Implementations

impl RefUnwindSafe for DB

impl Unpin for DB

impl UnwindSafe for DB

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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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.