pub struct Vault {
pub name: String,
pub path: PathBuf,
pub open: bool,
pub ts: u64,
}Expand description
Represents a single Obsidian vault.
A vault is a folder containing notes and other metadata.
Fields§
§name: StringThe name of the vault, inferred from its directory name.
path: PathBufFilesystem path to the vault’s directory.
open: boolWhether the vault is marked ‘open’ by Obsidian.
ts: u64Timestamp of last update or creation.
Implementations§
Source§impl Vault
impl Vault
Sourcepub fn entries(&self) -> Vec<VaultEntry>
pub fn entries(&self) -> Vec<VaultEntry>
Returns a Vec of Markdown vault entries in this vault as VaultEntry structs.
Entries can be either directories or files (notes). If the directory is marked hidden with
a dot (.) prefix it will be filtered out from the resulting Vec.
The returned entries are not sorted.
§Examples
use basalt_core::obsidian::{Vault, Note};
let vault = Vault {
name: "MyVault".into(),
path: "path/to/my_vault".into(),
..Default::default()
};
assert_eq!(vault.entries(), vec![]);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Vault
impl<'de> Deserialize<'de> for Vault
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
impl StructuralPartialEq for Vault
Auto Trait Implementations§
impl Freeze for Vault
impl RefUnwindSafe for Vault
impl Send for Vault
impl Sync for Vault
impl Unpin for Vault
impl UnwindSafe for Vault
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