pub struct MarkdownDB { /* private fields */ }Expand description
The primary interface for the Markdown VFS exposed to WebAssembly. It wraps a high-performance B-Tree index of headings and content.
Implementations§
Source§impl MarkdownDB
impl MarkdownDB
Sourcepub fn new(content: &str) -> MarkdownDB
pub fn new(content: &str) -> MarkdownDB
Creates a new instance by parsing and indexing the provided Markdown string.
Sourcepub fn ls(&self, path: &str, page: usize, page_size: usize) -> JsValue
pub fn ls(&self, path: &str, page: usize, page_size: usize) -> JsValue
Lists child sections for a given path with pagination.
Returns a JsValue containing the paginated results.
Sourcepub fn get_title(&self, path: &str) -> Option<String>
pub fn get_title(&self, path: &str) -> Option<String>
Returns the original title of a section at the specified path.
Sourcepub fn read(&self, path: &str) -> Option<String>
pub fn read(&self, path: &str) -> Option<String>
Retrieves the content of a section (excluding nested sub-sections).
Sourcepub fn read_full(&self, path: &str) -> Option<String>
pub fn read_full(&self, path: &str) -> Option<String>
Retrieves the content of a section INCLUDING all nested sub-sections.
Sourcepub fn get_reference(&self, ref_id: &str) -> Option<String>
pub fn get_reference(&self, ref_id: &str) -> Option<String>
Resolves a reference ID from the Markdown document.
Trait Implementations§
Source§impl From<MarkdownDB> for JsValue
impl From<MarkdownDB> for JsValue
Source§fn from(value: MarkdownDB) -> Self
fn from(value: MarkdownDB) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for MarkdownDB
impl FromWasmAbi for MarkdownDB
Source§impl IntoWasmAbi for MarkdownDB
impl IntoWasmAbi for MarkdownDB
Source§impl LongRefFromWasmAbi for MarkdownDB
impl LongRefFromWasmAbi for MarkdownDB
Source§impl OptionFromWasmAbi for MarkdownDB
impl OptionFromWasmAbi for MarkdownDB
Source§impl OptionIntoWasmAbi for MarkdownDB
impl OptionIntoWasmAbi for MarkdownDB
Source§impl RefFromWasmAbi for MarkdownDB
impl RefFromWasmAbi for MarkdownDB
Source§type Anchor = RcRef<MarkdownDB>
type Anchor = RcRef<MarkdownDB>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for MarkdownDB
impl RefMutFromWasmAbi for MarkdownDB
Source§impl TryFromJsValue for MarkdownDB
impl TryFromJsValue for MarkdownDB
Source§impl VectorFromWasmAbi for MarkdownDB
impl VectorFromWasmAbi for MarkdownDB
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[MarkdownDB]>
Source§impl VectorIntoWasmAbi for MarkdownDB
impl VectorIntoWasmAbi for MarkdownDB
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[MarkdownDB]>) -> Self::Abi
Source§impl WasmDescribeVector for MarkdownDB
impl WasmDescribeVector for MarkdownDB
impl SupportsConstructor for MarkdownDB
impl SupportsInstanceProperty for MarkdownDB
impl SupportsStaticProperty for MarkdownDB
Auto Trait Implementations§
impl Freeze for MarkdownDB
impl RefUnwindSafe for MarkdownDB
impl Send for MarkdownDB
impl Sync for MarkdownDB
impl Unpin for MarkdownDB
impl UnsafeUnpin for MarkdownDB
impl UnwindSafe for MarkdownDB
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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.