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
impl EntryDirectory
Sourcepub fn entry_artifact_root_path(&self, id: &EntryAddress) -> PathBuf
pub fn entry_artifact_root_path(&self, id: &EntryAddress) -> PathBuf
Sirno Lake artifact directory path for one entry address.
Sourcepub fn entry_artifact_path(
&self,
id: &EntryAddress,
path: &EntryArtifactPath,
) -> PathBuf
pub fn entry_artifact_path( &self, id: &EntryAddress, path: &EntryArtifactPath, ) -> PathBuf
Sirno Lake artifact file path for one entry-owned artifact.
Sourcepub fn entry_exists(
&self,
id: &EntryAddress,
) -> Result<bool, EntryDirectoryError>
pub fn entry_exists( &self, id: &EntryAddress, ) -> Result<bool, EntryDirectoryError>
Returns true when this directory contains the file for id.
Sourcepub fn read_entry_source(
&self,
id: &EntryAddress,
) -> Result<String, EntryDirectoryError>
pub fn read_entry_source( &self, id: &EntryAddress, ) -> Result<String, EntryDirectoryError>
Read one Sirno Lake Markdown entry file source by path.
Sourcepub fn read_entries_with_registry(
&self,
meta: &MetaRegistry,
ignore: impl IntoIterator<Item = PathBuf>,
) -> Result<Vec<Entry>, EntryDirectoryError>
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.
Sourcepub fn read_entry(
&self,
id: &EntryAddress,
) -> Result<Entry, EntryDirectoryError>
pub fn read_entry( &self, id: &EntryAddress, ) -> Result<Entry, EntryDirectoryError>
Read one Sirno Lake Markdown entry file by path.
Sourcepub fn replace_entry_source(
&self,
id: &EntryAddress,
source: &str,
) -> Result<PathBuf, EntryDirectoryError>
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.
Sourcepub fn write_entry_source(
&self,
id: &EntryAddress,
source: &str,
) -> Result<PathBuf, EntryDirectoryError>
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.
Sourcepub fn read_entry_artifacts(
&self,
id: &EntryAddress,
) -> Result<Vec<EntryArtifact>, EntryDirectoryError>
pub fn read_entry_artifacts( &self, id: &EntryAddress, ) -> Result<Vec<EntryArtifact>, EntryDirectoryError>
Read lake-owned artifacts for one entry address.
Sourcepub fn add_entry_artifact(
&self,
id: &EntryAddress,
source: &Path,
artifact_path: &EntryArtifactPath,
) -> Result<PathBuf, EntryDirectoryError>
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.
Sourcepub fn rename_entry_artifact(
&self,
id: &EntryAddress,
old_path: &EntryArtifactPath,
new_path: &EntryArtifactPath,
) -> Result<PathBuf, EntryDirectoryError>
pub fn rename_entry_artifact( &self, id: &EntryAddress, old_path: &EntryArtifactPath, new_path: &EntryArtifactPath, ) -> Result<PathBuf, EntryDirectoryError>
Rename one entry-owned artifact path.
Sourcepub fn remove_entry_artifact(
&self,
id: &EntryAddress,
artifact_path: &EntryArtifactPath,
) -> Result<PathBuf, EntryDirectoryError>
pub fn remove_entry_artifact( &self, id: &EntryAddress, artifact_path: &EntryArtifactPath, ) -> Result<PathBuf, EntryDirectoryError>
Remove one entry-owned artifact file.
Sourcepub fn check(
&self,
mode: CheckMode,
) -> Result<EntryDirectoryReport, EntryDirectoryError>
pub fn check( &self, mode: CheckMode, ) -> Result<EntryDirectoryReport, EntryDirectoryError>
Check this Sirno Lake entry directory.
Sourcepub fn check_with_settings(
&self,
mode: CheckMode,
settings: &EntryDirectoryCheckSettings,
) -> Result<EntryDirectoryReport, EntryDirectoryError>
pub fn check_with_settings( &self, mode: CheckMode, settings: &EntryDirectoryCheckSettings, ) -> Result<EntryDirectoryReport, EntryDirectoryError>
Check this Sirno Lake entry directory with explicit settings.
Sourcepub fn init(&self) -> Result<Vec<PathBuf>, EntryDirectoryError>
pub fn init(&self) -> Result<Vec<PathBuf>, EntryDirectoryError>
Initialize this directory with ordinary seed entries.
Existing entry files are never overwritten.
Sourcepub fn create_entry(
&self,
entry: &Entry,
) -> Result<PathBuf, EntryDirectoryError>
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.
Sourcepub fn freeze_entry(
&self,
id: &EntryAddress,
) -> Result<PathBuf, EntryDirectoryError>
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.
Sourcepub fn melt_entry(
&self,
id: &EntryAddress,
) -> Result<PathBuf, EntryDirectoryError>
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.
Sourcepub fn rename_entry(
&self,
old_id: &EntryAddress,
new_id: &EntryAddress,
settings: &EntryDirectoryCheckSettings,
) -> Result<EntryRenameReport, EntryDirectoryError>
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.
Sourcepub fn write(
&self,
entries: &[Entry],
policy: EntryDirectoryWritePolicy,
) -> Result<Vec<PathBuf>, EntryDirectoryError>
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.
Sourcepub fn write_with_artifacts(
&self,
entries: &[Entry],
artifacts: &[EntryArtifact],
policy: EntryDirectoryWritePolicy,
) -> Result<Vec<PathBuf>, EntryDirectoryError>
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.
Sourcepub fn replace_glacier(
&self,
domain: &EntryAtom,
entries: &[Entry],
artifacts: &[EntryArtifact],
settings: &EntryDirectoryCheckSettings,
) -> Result<GlacierReport, EntryDirectoryError>
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.
Sourcepub fn ensure_glacier_replaceable(
&self,
domain: &EntryAtom,
settings: &EntryDirectoryCheckSettings,
) -> Result<(), EntryDirectoryError>
pub fn ensure_glacier_replaceable( &self, domain: &EntryAtom, settings: &EntryDirectoryCheckSettings, ) -> Result<(), EntryDirectoryError>
Require all existing paths in a glacier domain to be crystallization-managed.
Sourcepub fn set_readonly(
&self,
settings: &EntryDirectoryCheckSettings,
) -> Result<(), EntryDirectoryError>
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.
Sourcepub fn set_writable(
&self,
settings: &EntryDirectoryCheckSettings,
) -> Result<(), EntryDirectoryError>
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.
Sourcepub fn clear_local_protection(
&self,
settings: &EntryDirectoryCheckSettings,
dry_run: bool,
) -> Result<EntryProtectionReport, EntryDirectoryError>
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.
Sourcepub fn fix_local_protection(
&self,
settings: &EntryDirectoryCheckSettings,
protect_checkout: bool,
dry_run: bool,
) -> Result<EntryProtectionReport, EntryDirectoryError>
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.
Sourcepub fn add_readonly_checkout_warnings(
&self,
paths: &[PathBuf],
) -> Result<(), EntryDirectoryError>
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.
Sourcepub fn generate_links(
&self,
settings: &StructuralSettings,
) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
pub fn generate_links( &self, settings: &StructuralSettings, ) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
Generate Markdown link footers for this Sirno Lake entry directory.
The directory must pass review-mode checks before any file is written.
Sourcepub fn check_generated_links(
&self,
settings: &StructuralSettings,
) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
pub fn check_generated_links( &self, settings: &StructuralSettings, ) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
Check which generated Markdown link footers would change in this directory.
No file is written.
Sourcepub fn generate_links_with_ignored_paths(
&self,
settings: &StructuralSettings,
ignore: impl IntoIterator<Item = PathBuf>,
) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
pub fn generate_links_with_ignored_paths( &self, settings: &StructuralSettings, ignore: impl IntoIterator<Item = PathBuf>, ) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
Generate Markdown link footers for this directory with ignored paths.
Ignored paths are relative to the entry directory root.
Sourcepub fn generate_links_with_check_settings(
&self,
settings: &EntryDirectoryCheckSettings,
) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
pub fn generate_links_with_check_settings( &self, settings: &EntryDirectoryCheckSettings, ) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
Generate Markdown link footers using directory check settings.
Sourcepub fn generate_links_for_crystallization(
&self,
settings: &EntryDirectoryCheckSettings,
) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
pub fn generate_links_for_crystallization( &self, settings: &EntryDirectoryCheckSettings, ) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
Generate Markdown link footers while allowing managed glacier entries to change.
Sourcepub fn check_generated_links_with_ignored_paths(
&self,
settings: &StructuralSettings,
ignore: impl IntoIterator<Item = PathBuf>,
) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
pub fn check_generated_links_with_ignored_paths( &self, settings: &StructuralSettings, ignore: impl IntoIterator<Item = PathBuf>, ) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
Check which generated Markdown link footers would change with ignored paths.
Ignored paths are relative to the entry directory root. No file is written.
Sourcepub fn check_generated_links_with_check_settings(
&self,
settings: &EntryDirectoryCheckSettings,
) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
pub fn check_generated_links_with_check_settings( &self, settings: &EntryDirectoryCheckSettings, ) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
Check generated Markdown link footers using directory check settings.
No file is written.
Sourcepub fn delete_generated_links(
&self,
) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
pub fn delete_generated_links( &self, ) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
Delete generated Markdown link footers from this Sirno Lake entry directory.
The directory must parse cleanly before any file is written.
Sourcepub fn delete_generated_links_with_ignored_paths(
&self,
ignore: impl IntoIterator<Item = PathBuf>,
) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
pub fn delete_generated_links_with_ignored_paths( &self, ignore: impl IntoIterator<Item = PathBuf>, ) -> Result<GenLinkDirectoryReport, EntryDirectoryError>
Delete generated Markdown link footers with ignored paths.
Ignored paths are relative to the entry directory root.
pub fn entry_file_path(&self, id: &EntryAddress) -> PathBuf
Trait Implementations§
Source§impl Clone for EntryDirectory
impl Clone for EntryDirectory
Source§fn clone(&self) -> EntryDirectory
fn clone(&self) -> EntryDirectory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EntryDirectory
impl Debug for EntryDirectory
impl Eq for EntryDirectory
Source§impl PartialEq for EntryDirectory
impl PartialEq for EntryDirectory
Source§fn eq(&self, other: &EntryDirectory) -> bool
fn eq(&self, other: &EntryDirectory) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EntryDirectory
Auto Trait Implementations§
impl Freeze for EntryDirectory
impl RefUnwindSafe for EntryDirectory
impl Send for EntryDirectory
impl Sync for EntryDirectory
impl Unpin for EntryDirectory
impl UnsafeUnpin for EntryDirectory
impl UnwindSafe for EntryDirectory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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