pub struct VaultFile {Show 14 fields
pub path: PathBuf,
pub content: String,
pub metadata: FileMetadata,
pub frontmatter: Option<Frontmatter>,
pub headings: Vec<Heading>,
pub links: Vec<Link>,
pub backlinks: HashSet<Link>,
pub blocks: Vec<Block>,
pub tags: Vec<Tag>,
pub callouts: Vec<Callout>,
pub tasks: Vec<TaskItem>,
pub is_parsed: bool,
pub parse_error: Option<String>,
pub last_parsed: Option<f64>,
}Expand description
A complete vault file with parsed content
Fields§
§path: PathBuf§content: String§metadata: FileMetadata§frontmatter: Option<Frontmatter>§headings: Vec<Heading>§links: Vec<Link>§backlinks: HashSet<Link>§blocks: Vec<Block>§callouts: Vec<Callout>§tasks: Vec<TaskItem>§is_parsed: bool§parse_error: Option<String>§last_parsed: Option<f64>Implementations§
Source§impl VaultFile
impl VaultFile
Sourcepub fn new(path: PathBuf, content: String, metadata: FileMetadata) -> VaultFile
pub fn new(path: PathBuf, content: String, metadata: FileMetadata) -> VaultFile
Create a new vault file
Sourcepub fn outgoing_links(&self) -> HashSet<&str>
pub fn outgoing_links(&self) -> HashSet<&str>
Get outgoing links
Sourcepub fn headings_by_text(&self) -> HashMap<&str, &Heading>
pub fn headings_by_text(&self) -> HashMap<&str, &Heading>
Get headings indexed by text
Sourcepub fn blocks_with_ids(&self) -> HashMap<&str, &Block>
pub fn blocks_with_ids(&self) -> HashMap<&str, &Block>
Get blocks with IDs
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VaultFile
impl<'de> Deserialize<'de> for VaultFile
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<VaultFile, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<VaultFile, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for VaultFile
impl Serialize for VaultFile
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for VaultFile
impl RefUnwindSafe for VaultFile
impl Send for VaultFile
impl Sync for VaultFile
impl Unpin for VaultFile
impl UnwindSafe for VaultFile
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