Skip to main content

EntryDirectory

Struct EntryDirectory 

Source
pub struct EntryDirectory { /* private fields */ }
Expand description

Sirno Lake entry directory.

Invariant: root is the directory containing Sirno Lake Markdown entry files.

Implementations§

Source§

impl EntryDirectory

Source

pub fn new(root: impl Into<PathBuf>) -> Self

Construct an entry directory rooted at root.

Source

pub fn root(&self) -> &Path

Directory containing Sirno Lake Markdown entry files.

Source

pub fn entry_artifact_root_path(&self, id: &EntryAddress) -> PathBuf

Sirno Lake artifact directory path for one entry address.

Source

pub fn entry_artifact_path( &self, id: &EntryAddress, path: &EntryArtifactPath, ) -> PathBuf

Sirno Lake artifact file path for one entry-owned artifact.

Source

pub fn entry_exists( &self, id: &EntryAddress, ) -> Result<bool, EntryDirectoryError>

Returns true when this directory contains the file for id.

Source

pub fn read_entry_source( &self, id: &EntryAddress, ) -> Result<String, EntryDirectoryError>

Read one Sirno Lake Markdown entry file source by path.

Source

pub fn read_entries_with_registry( &self, meta: &MetaRegistry, ignore: impl IntoIterator<Item = PathBuf>, ) -> Result<Vec<Entry>, EntryDirectoryError>

Read every projected Markdown entry through an external metadata registry.

This is used by mist projections. The projection is an interface over selected entries, while the reservoir supplies the lake-wide metadata vocabulary.

Source

pub fn read_entry( &self, id: &EntryAddress, ) -> Result<Entry, EntryDirectoryError>

Read one Sirno Lake Markdown entry file by path.

Source

pub fn replace_entry_source( &self, id: &EntryAddress, source: &str, ) -> Result<PathBuf, EntryDirectoryError>

Replace one existing Sirno Lake Markdown entry source.

The entry address controls the target path. Frozen entries cannot be changed through this low-level replacement.

Source

pub fn write_entry_source( &self, id: &EntryAddress, source: &str, ) -> Result<PathBuf, EntryDirectoryError>

Write one Sirno Lake Markdown entry source, creating it when absent.

Existing frozen entries cannot be changed.

Source

pub fn read_entry_artifacts( &self, id: &EntryAddress, ) -> Result<Vec<EntryArtifact>, EntryDirectoryError>

Read lake-owned artifacts for one entry address.

Source

pub fn add_entry_artifact( &self, id: &EntryAddress, source: &Path, artifact_path: &EntryArtifactPath, ) -> Result<PathBuf, EntryDirectoryError>

Copy one filesystem file into an entry’s artifact tree.

Source

pub fn rename_entry_artifact( &self, id: &EntryAddress, old_path: &EntryArtifactPath, new_path: &EntryArtifactPath, ) -> Result<PathBuf, EntryDirectoryError>

Rename one entry-owned artifact path.

Source

pub fn remove_entry_artifact( &self, id: &EntryAddress, artifact_path: &EntryArtifactPath, ) -> Result<PathBuf, EntryDirectoryError>

Remove one entry-owned artifact file.

Source

pub fn check( &self, mode: CheckMode, ) -> Result<EntryDirectoryReport, EntryDirectoryError>

Check this Sirno Lake entry directory.

Source

pub fn check_with_settings( &self, mode: CheckMode, settings: &EntryDirectoryCheckSettings, ) -> Result<EntryDirectoryReport, EntryDirectoryError>

Check this Sirno Lake entry directory with explicit settings.

Source

pub fn init(&self) -> Result<Vec<PathBuf>, EntryDirectoryError>

Initialize this directory with ordinary seed entries.

Existing entry files are never overwritten.

Source

pub fn create_entry( &self, entry: &Entry, ) -> Result<PathBuf, EntryDirectoryError>

Create one Sirno Lake Markdown entry file in this directory.

The entry directory is created if needed. Existing entry files are never overwritten.

Source

pub fn freeze_entry( &self, id: &EntryAddress, ) -> Result<PathBuf, EntryDirectoryError>

Mark one Sirno Lake Markdown entry as frozen and read-only.

The entry metadata gains the canonical reviewed frozen reason. Local file protection is applied after the reason is written.

Source

pub fn melt_entry( &self, id: &EntryAddress, ) -> Result<PathBuf, EntryDirectoryError>

Mark one Sirno Lake Markdown entry as melted and writable.

The canonical reviewed frozen reason is removed from entry metadata. The file is left writable so normal editing can resume.

Source

pub fn rename_entry( &self, old_id: &EntryAddress, new_id: &EntryAddress, settings: &EntryDirectoryCheckSettings, ) -> Result<EntryRenameReport, EntryDirectoryError>

Rename one entry address and every structural link reference that names it.

Existing generated-link regions are refreshed after metadata changes. Prose outside generated-link regions remains user-owned.

Source

pub fn write( &self, entries: &[Entry], policy: EntryDirectoryWritePolicy, ) -> Result<Vec<PathBuf>, EntryDirectoryError>

Write a complete Sirno Lake entry directory.

The write policy controls how existing target contents are handled.

Source

pub fn write_with_artifacts( &self, entries: &[Entry], artifacts: &[EntryArtifact], policy: EntryDirectoryWritePolicy, ) -> Result<Vec<PathBuf>, EntryDirectoryError>

Write a complete Sirno Lake entry directory with lake-owned artifacts.

The write policy controls how existing target contents are handled.

Source

pub fn replace_glacier( &self, domain: &EntryAtom, entries: &[Entry], artifacts: &[EntryArtifact], settings: &EntryDirectoryCheckSettings, ) -> Result<GlacierReport, EntryDirectoryError>

Replace one glacier.

Existing files under the glacier domain must already be managed by crystallization.

Source

pub fn ensure_glacier_replaceable( &self, domain: &EntryAtom, settings: &EntryDirectoryCheckSettings, ) -> Result<(), EntryDirectoryError>

Require all existing paths in a glacier domain to be crystallization-managed.

Source

pub fn set_readonly( &self, settings: &EntryDirectoryCheckSettings, ) -> Result<(), EntryDirectoryError>

Mark this directory as read-only.

Sirno removes ordinary write permission from managed paths. It also applies the best-effort immutable guard used by frozen entries. Ignored paths are left untouched.

Source

pub fn set_writable( &self, settings: &EntryDirectoryCheckSettings, ) -> Result<(), EntryDirectoryError>

Mark this directory as writable.

Sirno clears its best-effort immutable guard before restoring ordinary write permission. Ignored paths are left untouched.

Source

pub fn clear_local_protection( &self, settings: &EntryDirectoryCheckSettings, dry_run: bool, ) -> Result<EntryProtectionReport, EntryDirectoryError>

Clear every Sirno local protection guard in this directory.

Frozen metadata and checkout lock state remain unchanged. Ignored paths are left untouched.

Source

pub fn fix_local_protection( &self, settings: &EntryDirectoryCheckSettings, protect_checkout: bool, dry_run: bool, ) -> Result<EntryProtectionReport, EntryDirectoryError>

Reapply local protection from frozen metadata and checkout state.

protect_checkout selects the whole lake for an immutable managed checkout. Otherwise, only entries carrying frozen reasons and their artifact trees are protected. Ignored paths are left untouched.

Source

pub fn add_readonly_checkout_warnings( &self, paths: &[PathBuf], ) -> Result<(), EntryDirectoryError>

Add read-only checkout warnings to rendered entry files.

The warning is written as a Markdown blockquote at the beginning of the body.

Generate Markdown link footers for this Sirno Lake entry directory.

The directory must pass review-mode checks before any file is written.

Check which generated Markdown link footers would change in this directory.

No file is written.

Generate Markdown link footers for this directory with ignored paths.

Ignored paths are relative to the entry directory root.

Generate Markdown link footers using directory check settings.

Generate Markdown link footers while allowing managed glacier entries to change.

Check which generated Markdown link footers would change with ignored paths.

Ignored paths are relative to the entry directory root. No file is written.

Check generated Markdown link footers using directory check settings.

No file is written.

Delete generated Markdown link footers from this Sirno Lake entry directory.

The directory must parse cleanly before any file is written.

Delete generated Markdown link footers with ignored paths.

Ignored paths are relative to the entry directory root.

Source

pub fn entry_file_path(&self, id: &EntryAddress) -> PathBuf

Trait Implementations§

Source§

impl Clone for EntryDirectory

Source§

fn clone(&self) -> EntryDirectory

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for EntryDirectory

Source§

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

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

impl Eq for EntryDirectory

Source§

impl PartialEq for EntryDirectory

Source§

fn eq(&self, other: &EntryDirectory) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for EntryDirectory

Auto Trait Implementations§

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<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more