Vault

Struct Vault 

Source
pub struct Vault<N = NoteInMemory>
where N: Note,
{ /* private fields */ }
Expand description

Represents an entire Obsidian vault

Contains all parsed notes and metadata about the vault. Uses NoteOnDisk by default which is optimized for memory efficiency in large vaults.

Implementations§

Source§

impl<N> Vault<N>
where N: Note,

Source

pub fn get_duplicates_notes_by_name(&self) -> Vec<&N>

Returns duplicated note name

§Performance

Operates in O(n log n) time for large vaults

§Other

See have_unique_note_by_name

Source

pub fn have_duplicates_notes_by_name(&self) -> bool

Checks if all note name in the vault are unique

§Returns

true if all note name are unique, false otherwise

§Performance

Operates in O(n) time for large vaults

§Other

See get_duplicates_notes_by_name

Source§

impl<N> Vault<N>
where N: Note,

Source

pub fn build_vault( iter: impl Iterator<Item = N>, options: &VaultOptions, ) -> Self

Build vault from iterator

Source

pub fn par_build_vault( iter: impl ParallelIterator<Item = N>, options: &VaultOptions, ) -> Self
where N: Send,

Available on crate feature rayon only.

Build vault from parallel iterator

Source§

impl<F> Vault<F>
where F: Note,

Source

pub fn get_digraph(&self) -> Result<DiGraph<&F, ()>, F::Error>

Available on crate feature petgraph only.

Builds directed graph representing note relationships

Edges point from source note to linked note (A → B means A links to B)

§Performance Notes
  • For vaults with 1000+ notes, enable rayon feature
  • Uses NoteOnDisk for minimal memory footprint
§Other

See get_ungraph

Source

pub fn par_get_digraph(&self) -> Result<DiGraph<&F, ()>, F::Error>
where F: Send + Sync, F::Error: Send,

Available on crate features petgraph and rayon only.

Parallel builds directed graph representing note relationships

Edges point from source note to linked note (A → B means A links to B)

§Performance Notes
  • For vaults with 1000+ notes, enable rayon feature
  • Uses NoteOnDisk for minimal memory footprint
§Other

See par_get_ungraph

Source

pub fn get_ungraph(&self) -> Result<UnGraph<&F, ()>, F::Error>

Available on crate feature petgraph only.

Builds undirected graph showing note connections

Useful for connectivity analysis where direction doesn’t matter

Source

pub fn par_get_ungraph(&self) -> Result<UnGraph<&F, ()>, F::Error>
where F: Send + Sync, F::Error: Send,

Available on crate features petgraph and rayon only.

Parallel builds undirected graph showing note connections

Useful for connectivity analysis where direction doesn’t matter

Source§

impl<N> Vault<N>
where N: Note,

Source

pub const fn notes(&self) -> &Vec<N>

Get notes

Source

pub const fn mut_notes(&mut self) -> &mut Vec<N>

Get mutables notes

Source

pub const fn count_notes(&self) -> usize

Get count in notes from vault

Source

pub fn path(&self) -> &Path

Get path to vault

Trait Implementations§

Source§

impl<N> Clone for Vault<N>
where N: Note + Clone,

Source§

fn clone(&self) -> Vault<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<N> Debug for Vault<N>
where N: Note + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<N> Default for Vault<N>
where N: Note + Default,

Source§

fn default() -> Vault<N>

Returns the “default value” for a type. Read more
Source§

impl<N> PartialEq for Vault<N>
where N: Note + PartialEq,

Source§

fn eq(&self, other: &Vault<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<N> Eq for Vault<N>
where N: Note + Eq,

Source§

impl<N> StructuralPartialEq for Vault<N>
where N: Note,

Auto Trait Implementations§

§

impl<N> Freeze for Vault<N>

§

impl<N> RefUnwindSafe for Vault<N>
where N: RefUnwindSafe,

§

impl<N> Send for Vault<N>
where N: Send,

§

impl<N> Sync for Vault<N>
where N: Sync,

§

impl<N> Unpin for Vault<N>
where N: Unpin,

§

impl<N> UnwindSafe for Vault<N>
where N: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.