pub trait NamedTypeLinks<T: QueryAddress = u32> {
Show 34 methods
// Required methods
fn create(&mut self, source: T, target: T) -> T;
fn ensure_created(&mut self, id: T) -> T;
fn get_link(&mut self, id: T) -> Option<GenericLink<T>>;
fn exists(&mut self, id: T) -> bool;
fn update_observed(
&mut self,
id: T,
source: T,
target: T,
observer: ChangeObserver<'_, T>,
) -> Result<GenericLink<T>>;
fn delete_observed(
&mut self,
id: T,
observer: ChangeObserver<'_, T>,
) -> Result<GenericLink<T>>;
fn all_links(&mut self) -> Vec<GenericLink<T>>;
fn search(&mut self, source: T, target: T) -> Option<T>;
fn get_or_create(&mut self, source: T, target: T) -> T;
fn get_name(&mut self, id: T) -> Result<Option<String>>;
fn set_name(&mut self, id: T, name: &str) -> Result<T>;
fn get_by_name(&mut self, name: &str) -> Result<Option<T>>;
fn remove_name(&mut self, id: T) -> Result<()>;
fn save(&mut self) -> Result<()>;
// Provided methods
fn query_limits(&self) -> Option<QueryLimits> { ... }
fn reserve_query_allocations(
&mut self,
_processor: &GenericQueryProcessor<T>,
_restriction: &LinoLink,
_substitution: &LinoLink,
) -> Result<Option<HashSet<T>>> { ... }
fn try_create(&mut self, source: T, target: T) -> Result<T> { ... }
fn try_ensure_created(&mut self, id: T) -> Result<T> { ... }
fn reference_exists(&mut self, id: T) -> bool { ... }
fn claims(&mut self, id: T) -> Option<bool> { ... }
fn next_created_addresses(&mut self, count: usize) -> Result<Vec<T>> { ... }
fn update(&mut self, id: T, source: T, target: T) -> Result<GenericLink<T>> { ... }
fn delete(&mut self, id: T) -> Result<GenericLink<T>> { ... }
fn query_links(
&mut self,
index: Option<T>,
source: Option<T>,
target: Option<T>,
) -> Vec<GenericLink<T>> { ... }
fn try_get_or_create(&mut self, source: T, target: T) -> Result<T> { ... }
fn get_or_create_named(&mut self, name: &str) -> Result<T> { ... }
fn format_reference(&mut self, id: T) -> Result<String> { ... }
fn format_lino(&mut self, link: &GenericLink<T>) -> Result<String> { ... }
fn lino_lines(&mut self) -> Result<Vec<String>> { ... }
fn write_lino_output<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
where Self: Sized { ... }
fn print_all_lino(&mut self) -> Result<()> { ... }
fn print_change_lino(
&mut self,
before: &Option<GenericLink<T>>,
after: &Option<GenericLink<T>>,
) -> Result<()> { ... }
fn format_structure(&mut self, id: T) -> Result<String> { ... }
fn format_structure_recursive(
&mut self,
id: T,
visited: &mut HashSet<T>,
) -> Result<String> { ... }
}Required Methods§
fn create(&mut self, source: T, target: T) -> T
fn ensure_created(&mut self, id: T) -> T
fn get_link(&mut self, id: T) -> Option<GenericLink<T>>
fn exists(&mut self, id: T) -> bool
Sourcefn update_observed(
&mut self,
id: T,
source: T,
target: T,
observer: ChangeObserver<'_, T>,
) -> Result<GenericLink<T>>
fn update_observed( &mut self, id: T, source: T, target: T, observer: ChangeObserver<'_, T>, ) -> Result<GenericLink<T>>
Self::update, reporting every change the update caused.
An update that would duplicate an existing doublet is resolved into a
merge: the updated link is deleted and its usages are moved to the
duplicate, so one call can make several changes. The C# CLI sees them
because AdvancedMixedQueryProcessor hands a handler to the store:
links.Update(before, after, (beforeState, afterState) =>
options.ChangesHandler?.Invoke(beforeState, afterState) ?? links.Constants.Continue);Sourcefn delete_observed(
&mut self,
id: T,
observer: ChangeObserver<'_, T>,
) -> Result<GenericLink<T>>
fn delete_observed( &mut self, id: T, observer: ChangeObserver<'_, T>, ) -> Result<GenericLink<T>>
Self::delete, reporting every change the deletion caused.
Deleting a link cascades into every link that still used it, and each of
those removals is a change in its own right, reported the way
AdvancedMixedQueryProcessor.RemoveLinks reports them in C#:
links.Delete(link, (before, after) =>
options.ChangesHandler?.Invoke(before, after) ?? links.Constants.Continue);fn all_links(&mut self) -> Vec<GenericLink<T>>
fn search(&mut self, source: T, target: T) -> Option<T>
fn get_or_create(&mut self, source: T, target: T) -> T
fn get_name(&mut self, id: T) -> Result<Option<String>>
fn set_name(&mut self, id: T, name: &str) -> Result<T>
fn get_by_name(&mut self, name: &str) -> Result<Option<T>>
fn remove_name(&mut self, id: T) -> Result<()>
fn save(&mut self) -> Result<()>
Provided Methods§
Sourcefn query_limits(&self) -> Option<QueryLimits>
fn query_limits(&self) -> Option<QueryLimits>
A checked transport may restrict numeric input and query expansion.
Sourcefn reserve_query_allocations(
&mut self,
_processor: &GenericQueryProcessor<T>,
_restriction: &LinoLink,
_substitution: &LinoLink,
) -> Result<Option<HashSet<T>>>
fn reserve_query_allocations( &mut self, _processor: &GenericQueryProcessor<T>, _restriction: &LinoLink, _substitution: &LinoLink, ) -> Result<Option<HashSet<T>>>
Reserve the actual allocation sequence without staging observable rows. Backends with a recycling allocator may retain the legacy probe path.
Sourcefn try_create(&mut self, source: T, target: T) -> Result<T>
fn try_create(&mut self, source: T, target: T) -> Result<T>
Fallible allocation for backends that can report transaction/address errors.
fn try_ensure_created(&mut self, id: T) -> Result<T>
Sourcefn reference_exists(&mut self, id: T) -> bool
fn reference_exists(&mut self, id: T) -> bool
Whether a reference of a query to id names a link that exists.
The same as Self::exists, but for a view that hides links: a
reference is a right of its own, so a link the subject cannot read
exists for a reference when the subject may refer to it, and otherwise
answers as a missing one (issue #161).
Sourcefn claims(&mut self, id: T) -> Option<bool>
fn claims(&mut self, id: T) -> Option<bool>
Whether id is an address of this store, so a link created there
(Self::ensure_created, the undo of a delete) belongs in it; None
for a plain store, which has no addresses of its own.
A store made of others answers: a RemapLinks
claims the addresses of its map, and a UnionLinks
creates a link at an address in the first member that claims it, the
primary one when none does, so a union recreates a link in the member
its address is of (issue #149). The C# twin is IComposedLinks.Claims.
Sourcefn next_created_addresses(&mut self, count: usize) -> Result<Vec<T>>
fn next_created_addresses(&mut self, count: usize) -> Result<Vec<T>>
The addresses the next count links created in the store get.
A store reuses the address freed last first, so the lowest free one is not necessarily next. Creating the links and deleting them again in reverse leaves the store exactly as it was, and is the one way to ask any store, a remote one included. A view that may not create asks the store below.
fn update(&mut self, id: T, source: T, target: T) -> Result<GenericLink<T>>
fn delete(&mut self, id: T) -> Result<GenericLink<T>>
Sourcefn query_links(
&mut self,
index: Option<T>,
source: Option<T>,
target: Option<T>,
) -> Vec<GenericLink<T>>
fn query_links( &mut self, index: Option<T>, source: Option<T>, target: Option<T>, ) -> Vec<GenericLink<T>>
The links that match a pattern, where None matches any value, in
the order of their addresses.
The default filters Self::all_links; a store with a lookup index
overrides it.
Sourcefn try_get_or_create(&mut self, source: T, target: T) -> Result<T>
fn try_get_or_create(&mut self, source: T, target: T) -> Result<T>
Fallible pair lookup/allocation for composable query and decorator writes.
fn get_or_create_named(&mut self, name: &str) -> Result<T>
fn format_reference(&mut self, id: T) -> Result<String>
fn format_lino(&mut self, link: &GenericLink<T>) -> Result<String>
fn lino_lines(&mut self) -> Result<Vec<String>>
fn write_lino_output<P: AsRef<Path>>(&mut self, path: P) -> Result<()>where
Self: Sized,
fn print_all_lino(&mut self) -> Result<()>
fn print_change_lino( &mut self, before: &Option<GenericLink<T>>, after: &Option<GenericLink<T>>, ) -> Result<()>
fn format_structure(&mut self, id: T) -> Result<String>
fn format_structure_recursive( &mut self, id: T, visited: &mut HashSet<T>, ) -> Result<String>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T: QueryAddress, L: NamedTypeLinks<T> + ?Sized> NamedTypeLinks<T> for &mut L
A borrowed store is a store: a layer can wrap &mut store and leave the
store with its owner, as the permission policy does when it reads the
types of the data through a TypesDecorator.
impl<T: QueryAddress, L: NamedTypeLinks<T> + ?Sized> NamedTypeLinks<T> for &mut L
A borrowed store is a store: a layer can wrap &mut store and leave the
store with its owner, as the permission policy does when it reads the
types of the data through a TypesDecorator.