Skip to main content

LinkStorage

Struct LinkStorage 

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

LinkStorage provides persistent storage for links Corresponds to the storage functionality in NamedLinksDecorator in C#

Implementations§

Source§

impl LinkStorage

Source

pub fn new<P: AsRef<Path>>(db_path: P, trace: bool) -> Result<Self>

Creates a new LinkStorage instance

The database location is accepted as any AsRef<Path>, so embedding applications can pass a PathBuf (or an OsStr on platforms with non-UTF-8 paths) instead of a &str.

Source

pub fn database_path(&self) -> &Path

The database file this storage reads from and writes to.

Source

pub fn observed_revision(&self) -> StorageRevision

The revision of the database file observed at the last load or save.

Source

pub fn refresh_observed_revision(&mut self) -> Result<(), LinkError>

Re-reads the database file’s revision fingerprint, marking the current on-disk state as “seen” for LinksStorage::has_external_changes.

Source

pub fn reload_from_disk(&mut self) -> Result<()>

Discards in-memory state and re-reads the database file.

Source

pub fn save(&self) -> Result<()>

Saves all links to the database file

Source

pub fn create(&mut self, source: u32, target: u32) -> u32

Creates a new link and returns its ID

The address is the one allocate hands out: a freed one when the store has any, and only otherwise a fresh one past the end.

Source

pub fn ensure_created(&mut self, id: u32) -> u32

Creates the link at id, as an empty (id: 0 0) link.

Reaching a specific address means asking the allocator for links until it hands that one out, and the ones it handed out on the way are freed again — they were never asked for. This is ILinksExtensions.EnsureCreated in the C# implementation:

do { createdLink = creator(); createdLinks.Add(createdLink); }
while (createdLink != max);
for (var i = 0; i < createdLinks.Count; i++)
    if (!nonExistentAddresses.Contains(createdLinks[i]))
        links.Delete(createdLinks[i]);

Freeing them in the order they were created is what leaves the last one on top of the free list, so it is the address the next created link gets.

Source

pub fn get(&self, id: u32) -> Option<&Link>

Gets a link by ID

Source

pub fn exists(&self, id: u32) -> bool

Checks if a link exists

Source

pub fn update_raw(&mut self, id: u32, source: u32, target: u32) -> Result<Link>

Updates a link’s source and target without applying any policy.

This is the raw store operation, the equivalent of writing straight to UnitedMemoryLinks in the C# implementation. LinkStorage::update wraps it with the upstream uniqueness/usages decorators; use this method when you are supplying your own decorator stack (or deliberately want none).

Source

pub fn delete_raw(&mut self, id: u32) -> Result<Link>

Deletes a link by ID without applying any policy.

The raw counterpart of LinkStorage::delete: it removes exactly the requested link (and its name), leaving any link that referenced it dangling.

Source

pub fn update(&mut self, id: u32, source: u32, target: u32) -> Result<Link>

Updates a link’s source and target through the upstream doublets uniqueness and usages resolution stack.

This mirrors the C# implementation, which always talks to a UnitedMemoryLinks wrapped in DecorateWithAutomaticUniquenessAndUsagesResolution(). Concretely: if another link already holds (source, target), every reference to id is re-pointed at that link and id is deleted, instead of storing a duplicate doublet.

Returns the state the link was in before the operation. Use LinkStorage::update_raw for the undecorated write.

Source

pub fn update_observed( &mut self, id: u32, source: u32, target: u32, observer: ChangeObserver<'_>, ) -> Result<Link>

LinkStorage::update, reporting every change the decorator stack made.

Resolving a duplicate doublet re-points and deletes other links, so one call can produce several changes. Layers above the storage need to see all of them — the C# implementation gets them for free because its decorators forward to a WriteHandler:

var result = _links.Update(restriction, substitution, (before, after) => { ... });

observer is that handler. A change with a null after is a deletion.

Source

pub fn delete(&mut self, id: u32) -> Result<Link>

Deletes a link through the upstream doublets uniqueness and usages resolution stack, cascading to every link that references it.

This mirrors the C# implementation’s DecorateWithAutomaticUniquenessAndUsagesResolution() behaviour: the link is reset to (null, null), everything that still references it is deleted first, and only then is the link itself removed. Cycles terminate rather than recursing forever.

Returns the state the requested link was in before the operation. Use LinkStorage::delete_raw for the undecorated removal.

Source

pub fn delete_observed( &mut self, id: u32, observer: ChangeObserver<'_>, ) -> Result<Link>

LinkStorage::delete, reporting every change the decorator stack made.

A cascading delete removes every link that still referenced id, so one call can produce several changes; see LinkStorage::update_observed.

Source

pub fn all(&self) -> Vec<&Link>

Every stored link, ordered by address.

The order is part of the contract, not an implementation detail: the query processor enumerates links through this method, so an unspecified order would make pattern matching — and with it the order --changes reports and the order a cascading delete visits usages — vary between runs of the very same query. HashMap::values is exactly such an order, seeded randomly per process. Sorting reproduces what the C# store does naturally: UnitedMemoryLinks walks allocated addresses from 1 upwards.

Source

pub fn query( &self, index: Option<u32>, source: Option<u32>, target: Option<u32>, ) -> Vec<&Link>

Returns all links matching a query pattern

Source

pub fn search(&self, source: u32, target: u32) -> Option<u32>

Searches for a link with the given source and target.

When several links share the pair, the lowest address wins, so the result never depends on hash map iteration order.

Source

pub fn get_or_create(&mut self, source: u32, target: u32) -> u32

Gets or creates a link with the given source and target.

The two calls are fully qualified on purpose. LinkStorage also implements the upstream Doublets trait — including for &mut LinkStorage, so that a borrowed store can be decorated — and inside an inherent &mut self method the receiver’s type is exactly &mut LinkStorage. Method resolution reaches the trait impl on the reference before it derefs to the inherent impl, so a bare self.search(..) silently resolves to Doublets::search, which interprets LinksConstants::any as a wildcard instead of matching it literally. Naming the inherent methods keeps the exact-match semantics this function documents.

Source

pub fn format(&self, link: &Link) -> String

Formats a link for display

Source

pub fn format_lino(&self, link: &Link) -> String

Formats a link as LiNo suitable for database export.

Source

pub fn lino_lines(&self) -> Vec<String>

Returns all database links as sorted LiNo lines.

Source

pub fn write_lino_output<P: AsRef<Path>>(&self, path: P) -> Result<()>

Writes the complete database as LiNo.

Source

pub fn format_structure(&self, id: u32) -> Result<String>

Formats the structure of a link

Prints all links

Source

pub fn print_change(&self, before: &Option<Link>, after: &Option<Link>)

Prints a change (before -> after)

Source

pub fn get_or_create_named(&mut self, name: &str) -> u32

Gets or creates a link with a name

Source

pub fn set_name(&mut self, id: u32, name: &str)

Sets the name for a link

Source

pub fn get_name(&self, id: u32) -> Option<&String>

Gets the name of a link

Source

pub fn get_by_name(&self, name: &str) -> Option<u32>

Gets a link ID by name

Source

pub fn remove_name(&mut self, id: u32)

Removes the name for a link

Source

pub fn is_trace_enabled(&self) -> bool

Returns true if trace mode is enabled

Trait Implementations§

Source§

impl Doublets<u32> for LinkStorage

Returns the link at index, or None if it does not exist.
Source§

fn count_by(&self, query: impl ToQuery<T>) -> T
where Self: Sized,

Counts links matching query.
Source§

fn count(&self) -> T
where Self: Sized,

Returns the total number of links in the store.
Source§

fn create_by_with<F>( &mut self, query: impl ToQuery<T>, handler: F, ) -> Result<Flow, Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Creates a link matching query, calling handler on each created link.
Source§

fn create_by(&mut self, query: impl ToQuery<T>) -> Result<T, Error<T>>
where Self: Sized,

Creates a link matching query and returns its index.
Source§

fn create_with<F>(&mut self, handler: F) -> Result<Flow, Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Creates a new link and calls handler with the before/after states.
Source§

fn create(&mut self) -> Result<T, Error<T>>
where Self: Sized,

Creates a new uninitialized link and returns its index.
Source§

fn each_by<F>(&self, query: impl ToQuery<T>, handler: F) -> Flow
where F: FnMut(Link<T>) -> Flow, Self: Sized,

Iterates over links matching query, calling handler for each.
Source§

fn each<F>(&self, handler: F) -> Flow
where F: FnMut(Link<T>) -> Flow, Self: Sized,

Iterates over all links in the store, calling handler for each.
Source§

fn update_by_with<H>( &mut self, query: impl ToQuery<T>, change: impl ToQuery<T>, handler: H, ) -> Result<Flow, Error<T>>
where H: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Updates links matching query to change, calling handler with before/after.
Source§

fn update_by( &mut self, query: impl ToQuery<T>, change: impl ToQuery<T>, ) -> Result<T, Error<T>>
where Self: Sized,

Updates links matching query to change and returns the updated link’s index.
Source§

fn update_with<F>( &mut self, index: T, source: T, target: T, handler: F, ) -> Result<Flow, Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Updates the link at index to (index, source, target), calling handler.
Source§

fn update(&mut self, index: T, source: T, target: T) -> Result<T, Error<T>>
where Self: Sized,

Updates the link at index to (index, source, target) and returns the index.
Source§

fn delete_by_with<F>( &mut self, query: impl ToQuery<T>, handler: F, ) -> Result<Flow, Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Deletes links matching query, calling handler with before/after states.
Source§

fn delete_by(&mut self, query: impl ToQuery<T>) -> Result<T, Error<T>>
where Self: Sized,

Deletes links matching query and returns the deleted link’s index.
Source§

fn delete_with<F>(&mut self, index: T, handler: F) -> Result<Flow, Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Deletes the link at index, calling handler with before/after states.
Source§

fn delete(&mut self, index: T) -> Result<T, Error<T>>
where Self: Sized,

Deletes the link at index and returns its former index.
Returns the link at index, or Err(Error::NotExists) if it does not exist.
Source§

fn delete_all(&mut self) -> Result<(), Error<T>>
where Self: Sized,

Deletes all links in the store.
Source§

fn delete_query_with<F>( &mut self, query: impl ToQuery<T>, handler: F, ) -> Result<(), Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Deletes all links matching query, calling handler for each deletion.
Source§

fn delete_usages_with<F>( &mut self, index: T, handler: F, ) -> Result<(), Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Deletes all links that use index as a source or target, calling handler for each.
Source§

fn delete_usages(&mut self, index: T) -> Result<(), Error<T>>
where Self: Sized,

Deletes all links that use index as a source or target.
Source§

fn create_point(&mut self) -> Result<T, Error<T>>
where Self: Sized,

Creates a self-referential point link and returns its index.
Creates a link from source to target, calling handler with before/after states.
Creates a link from source to target and returns its index.
Source§

fn found(&self, query: impl ToQuery<T>) -> bool
where Self: Sized,

Returns true if at least one link matches query.
Source§

fn find(&self, query: impl ToQuery<T>) -> Option<Link<T>>
where Self: Sized,

Returns the first link matching query, or None.
Source§

fn search(&self, source: T, target: T) -> Option<T>
where Self: Sized,

Returns the index of a link with the given source and target, or None.
Source§

fn search_or(&self, source: T, target: T, default: T) -> T
where Self: Sized,

👎Deprecated:

use search instead

Source§

fn single(&self, query: impl ToQuery<T>) -> Option<Link<T>>
where Self: Sized,

Returns the link matching query only if exactly one link matches; None otherwise.
Source§

fn get_or_create(&mut self, source: T, target: T) -> Result<T, Error<T>>
where Self: Sized,

Returns the index of the (source, target) link, creating it if it does not exist.
Source§

fn count_usages(&self, index: T) -> Result<T, Error<T>>
where Self: Sized,

Returns the number of other links that reference index as a source or target.
Source§

fn usages(&self, index: T) -> Result<Vec<T>, Error<T>>
where Self: Sized,

Returns the indices of all links that reference index as a source or target.
Source§

fn exist(&self, link: T) -> bool
where Self: Sized,

Returns true if the link at link exists (internal or external).
Source§

fn has_usages(&self, link: T) -> bool
where Self: Sized,

Returns true if any other link references link as a source or target.
Source§

fn rebase_with<F>(&mut self, old: T, new: T, handler: F) -> Result<(), Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Re-points all usages of old to new, calling handler for each update.
Source§

fn rebase(&mut self, old: T, new: T) -> Result<T, Error<T>>
where Self: Sized,

Re-points all usages of old to new and returns new.
Source§

fn rebase_and_delete(&mut self, old: T, new: T) -> Result<T, Error<T>>
where Self: Sized,

Re-points all usages of old to new, then deletes old. Returns new.
Source§

impl Doublets<u32> for &mut LinkStorage

Returns the link at index, or None if it does not exist.
Source§

fn count_by(&self, query: impl ToQuery<T>) -> T
where Self: Sized,

Counts links matching query.
Source§

fn count(&self) -> T
where Self: Sized,

Returns the total number of links in the store.
Source§

fn create_by_with<F>( &mut self, query: impl ToQuery<T>, handler: F, ) -> Result<Flow, Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Creates a link matching query, calling handler on each created link.
Source§

fn create_by(&mut self, query: impl ToQuery<T>) -> Result<T, Error<T>>
where Self: Sized,

Creates a link matching query and returns its index.
Source§

fn create_with<F>(&mut self, handler: F) -> Result<Flow, Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Creates a new link and calls handler with the before/after states.
Source§

fn create(&mut self) -> Result<T, Error<T>>
where Self: Sized,

Creates a new uninitialized link and returns its index.
Source§

fn each_by<F>(&self, query: impl ToQuery<T>, handler: F) -> Flow
where F: FnMut(Link<T>) -> Flow, Self: Sized,

Iterates over links matching query, calling handler for each.
Source§

fn each<F>(&self, handler: F) -> Flow
where F: FnMut(Link<T>) -> Flow, Self: Sized,

Iterates over all links in the store, calling handler for each.
Source§

fn update_by_with<H>( &mut self, query: impl ToQuery<T>, change: impl ToQuery<T>, handler: H, ) -> Result<Flow, Error<T>>
where H: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Updates links matching query to change, calling handler with before/after.
Source§

fn update_by( &mut self, query: impl ToQuery<T>, change: impl ToQuery<T>, ) -> Result<T, Error<T>>
where Self: Sized,

Updates links matching query to change and returns the updated link’s index.
Source§

fn update_with<F>( &mut self, index: T, source: T, target: T, handler: F, ) -> Result<Flow, Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Updates the link at index to (index, source, target), calling handler.
Source§

fn update(&mut self, index: T, source: T, target: T) -> Result<T, Error<T>>
where Self: Sized,

Updates the link at index to (index, source, target) and returns the index.
Source§

fn delete_by_with<F>( &mut self, query: impl ToQuery<T>, handler: F, ) -> Result<Flow, Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Deletes links matching query, calling handler with before/after states.
Source§

fn delete_by(&mut self, query: impl ToQuery<T>) -> Result<T, Error<T>>
where Self: Sized,

Deletes links matching query and returns the deleted link’s index.
Source§

fn delete_with<F>(&mut self, index: T, handler: F) -> Result<Flow, Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Deletes the link at index, calling handler with before/after states.
Source§

fn delete(&mut self, index: T) -> Result<T, Error<T>>
where Self: Sized,

Deletes the link at index and returns its former index.
Returns the link at index, or Err(Error::NotExists) if it does not exist.
Source§

fn delete_all(&mut self) -> Result<(), Error<T>>
where Self: Sized,

Deletes all links in the store.
Source§

fn delete_query_with<F>( &mut self, query: impl ToQuery<T>, handler: F, ) -> Result<(), Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Deletes all links matching query, calling handler for each deletion.
Source§

fn delete_usages_with<F>( &mut self, index: T, handler: F, ) -> Result<(), Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Deletes all links that use index as a source or target, calling handler for each.
Source§

fn delete_usages(&mut self, index: T) -> Result<(), Error<T>>
where Self: Sized,

Deletes all links that use index as a source or target.
Source§

fn create_point(&mut self) -> Result<T, Error<T>>
where Self: Sized,

Creates a self-referential point link and returns its index.
Creates a link from source to target, calling handler with before/after states.
Creates a link from source to target and returns its index.
Source§

fn found(&self, query: impl ToQuery<T>) -> bool
where Self: Sized,

Returns true if at least one link matches query.
Source§

fn find(&self, query: impl ToQuery<T>) -> Option<Link<T>>
where Self: Sized,

Returns the first link matching query, or None.
Source§

fn search(&self, source: T, target: T) -> Option<T>
where Self: Sized,

Returns the index of a link with the given source and target, or None.
Source§

fn search_or(&self, source: T, target: T, default: T) -> T
where Self: Sized,

👎Deprecated:

use search instead

Source§

fn single(&self, query: impl ToQuery<T>) -> Option<Link<T>>
where Self: Sized,

Returns the link matching query only if exactly one link matches; None otherwise.
Source§

fn get_or_create(&mut self, source: T, target: T) -> Result<T, Error<T>>
where Self: Sized,

Returns the index of the (source, target) link, creating it if it does not exist.
Source§

fn count_usages(&self, index: T) -> Result<T, Error<T>>
where Self: Sized,

Returns the number of other links that reference index as a source or target.
Source§

fn usages(&self, index: T) -> Result<Vec<T>, Error<T>>
where Self: Sized,

Returns the indices of all links that reference index as a source or target.
Source§

fn exist(&self, link: T) -> bool
where Self: Sized,

Returns true if the link at link exists (internal or external).
Source§

fn has_usages(&self, link: T) -> bool
where Self: Sized,

Returns true if any other link references link as a source or target.
Source§

fn rebase_with<F>(&mut self, old: T, new: T, handler: F) -> Result<(), Error<T>>
where F: FnMut(Link<T>, Link<T>) -> Flow, Self: Sized,

Re-points all usages of old to new, calling handler for each update.
Source§

fn rebase(&mut self, old: T, new: T) -> Result<T, Error<T>>
where Self: Sized,

Re-points all usages of old to new and returns new.
Source§

fn rebase_and_delete(&mut self, old: T, new: T) -> Result<T, Error<T>>
where Self: Sized,

Re-points all usages of old to new, then deletes old. Returns new.
Source§

impl Links<u32> for LinkStorage

Source§

fn constants(&self) -> &LinksConstants<u32>

Returns the store’s LinksConstants (any/null/range values).
Counts links that match query.
Creates one or more links matching query and reports each creation via handler.
Iterates over links matching query, calling handler for each.
Updates links matching query to the new values in change, reporting via handler.
Deletes links matching query and reports each deletion via handler.
Source§

impl Links<u32> for &mut LinkStorage

doublets ships no blanket implementation for references, so decorating a borrowed store (instead of moving it into the decorator) needs this forwarding impl. It is what lets LinkStorage decorate itself for the duration of a single operation.

Source§

fn constants(&self) -> &LinksConstants<u32>

Returns the store’s LinksConstants (any/null/range values).
Counts links that match query.
Creates one or more links matching query and reports each creation via handler.
Iterates over links matching query, calling handler for each.
Updates links matching query to the new values in change, reporting via handler.
Deletes links matching query and reports each deletion via handler.
Source§

impl LinksStorage<u32> for LinkStorage

Creates a new link and returns its address.
Ensures a link exists at index, creating placeholders as needed.
Returns the link stored at index, if any.
Returns true when a link exists at index.
Repoints index at source/target, returning the previous state.
Deletes index, returning the link that was removed.
Self::update_link, reporting every (before, after) change it made. Read more
Self::delete_link, reporting every (before, after) change it made. Read more
Returns every link in the store.
Returns every link matching the (optional) index/source/target pattern.
Finds the address of a link with the given source and target.
Returns the address of an existing (source, target) link, creating it when it does not exist yet.
Source§

fn flush(&mut self) -> Result<(), LinkError>

Makes every write durable on disk. Read more
Source§

fn has_external_changes(&self) -> Result<bool, LinkError>

Cheap check for “did another process write to this database since we last read or wrote it?”. Read more
Source§

fn reload(&mut self) -> Result<(), LinkError>

Re-reads the database from disk, discarding cached state. Read more
Number of links currently stored.
Source§

impl LinksStorageRef<u32> for LinkStorage

Borrows the link stored at index.
Borrows every link in the store.
Borrows every link matching the (optional) index/source/target pattern.
Source§

fn create(&mut self, source: u32, target: u32) -> u32

Source§

fn ensure_created(&mut self, id: u32) -> u32

Source§

fn exists(&mut self, id: u32) -> bool

Source§

fn update(&mut self, id: u32, source: u32, target: u32) -> Result<Link>

Source§

fn delete(&mut self, id: u32) -> Result<Link>

Source§

fn delete_observed( &mut self, id: u32, observer: ChangeObserver<'_>, ) -> Result<Link>

Self::delete, reporting every change the deletion caused. Read more
Source§

fn search(&mut self, source: u32, target: u32) -> Option<u32>

Source§

fn get_or_create(&mut self, source: u32, target: u32) -> u32

Source§

fn get_name(&mut self, id: u32) -> Result<Option<String>>

Source§

fn set_name(&mut self, id: u32, name: &str) -> Result<u32>

Source§

fn get_by_name(&mut self, name: &str) -> Result<Option<u32>>

Source§

fn remove_name(&mut self, id: u32) -> Result<()>

Source§

fn save(&mut self) -> Result<()>

Source§

fn get_or_create_named(&mut self, name: &str) -> Result<u32>

Source§

fn try_ensure_created(&mut self, id: u32) -> Result<u32>

Source§

fn format_reference(&mut self, id: u32) -> Result<String>

Source§

fn format_lino(&mut self, link: &Link) -> Result<String>

Source§

fn lino_lines(&mut self) -> Result<Vec<String>>

Source§

fn write_lino_output<P: AsRef<Path>>(&mut self, path: P) -> Result<()>

Source§

fn print_all_lino(&mut self) -> Result<()>

Source§

fn print_change_lino( &mut self, before: &Option<Link>, after: &Option<Link>, ) -> Result<()>

Source§

fn format_structure(&mut self, id: u32) -> Result<String>

Source§

fn format_structure_recursive( &mut self, id: u32, visited: &mut HashSet<u32>, ) -> Result<String>

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, L> DecoratorsExt<T> for L
where T: LinkReference, L: Doublets<T>,

Source§

fn with_uniqueness<P>( self, _policy: P, ) -> <P as UniquenessPolicy>::Decorator<T, Self>

Source§

fn with_usages<P>(self, _policy: P) -> <P as UsagesPolicy>::Decorator<T, Self>
where P: UsagesPolicy,

Source§

fn with_usages_validation(self) -> UsagesValidator<T, Self>

Wraps in UsagesValidator.
Source§

fn with_cascade_usages_resolution(self) -> CascadeUsagesResolver<T, Self>

Source§

fn with_inner_reference_existence_validation( self, ) -> InnerReferenceExistenceValidator<T, Self>

Source§

fn with_non_existent_dependencies_creation( self, ) -> NonExistentDependenciesCreator<T, Self>

Source§

fn with_itself_constant_resolution( self, ) -> ItselfConstantToSelfReferenceResolver<T, Self>

Source§

fn with_null_constant_resolution( self, ) -> NullConstantToSelfReferenceResolver<T, Self>

Source§

fn with_non_null_contents_deletion_resolution( self, ) -> NonNullContentsLinkDeletionResolver<T, Self>

Source§

fn with_logging<W>(self, writer: W) -> LoggingDecorator<T, Self, W>
where W: Write + Send + Sync,

Wraps in LoggingDecorator, logging every mutation to writer.
Source§

fn with_no_exceptions(self) -> NoExceptionsDecorator<T, Self>

Source§

fn with_automatic_uniqueness_and_usages_resolution( self, ) -> CascadeUniquenessAndUsagesResolver<T, NonNullContentsLinkDeletionResolver<T, CascadeUsagesResolver<T, Self>>>

Builds the same stack as C# ILinksExtensions.DecorateWithAutomaticUniquenessAndUsagesResolution: CascadeUsagesResolver innermost, then NonNullContentsLinkDeletionResolver, then CascadeUniquenessAndUsagesResolver outermost.
Source§

impl<T, All> DoubletsExt<T> for All
where T: LinkReference, All: Doublets<T>,

Source§

fn iter( &self, ) -> impl Iterator<Item = Link<T>> + ExactSizeIterator + DoubleEndedIterator

Returns an iterator over all links in the store.
Source§

fn each_iter( &self, query: impl ToQuery<T>, ) -> impl Iterator<Item = Link<T>> + ExactSizeIterator + DoubleEndedIterator

Returns an iterator over links matching query.
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.