pub struct NamedLinksStorage<L: NamedTypeLinks> { /* private fields */ }Expand description
A NamedTypeLinks layer seen as a LinksStorage; see the
module documentation.
Implementations§
Source§impl<L: NamedTypeLinks> NamedLinksStorage<L>
impl<L: NamedTypeLinks> NamedLinksStorage<L>
Trait Implementations§
Source§impl<L: NamedTypeLinks> LinksStorage<u32> for NamedLinksStorage<L>
impl<L: NamedTypeLinks> LinksStorage<u32> for NamedLinksStorage<L>
Source§fn create_link(&mut self, source: u32, target: u32) -> Result<u32, LinkError>
fn create_link(&mut self, source: u32, target: u32) -> Result<u32, LinkError>
Creates a link and returns its address. A uniqueness resolver may return
an existing link after removing the temporary allocation.
Source§fn ensure_link_created(&mut self, index: u32) -> Result<u32, LinkError>
fn ensure_link_created(&mut self, index: u32) -> Result<u32, LinkError>
Ensures a link exists at
index, creating placeholders as needed.Source§fn link_exists(&self, index: u32) -> bool
fn link_exists(&self, index: u32) -> bool
Returns
true when a link exists at index.Source§fn update_link(
&mut self,
index: u32,
source: u32,
target: u32,
) -> Result<Link, LinkError>
fn update_link( &mut self, index: u32, source: u32, target: u32, ) -> Result<Link, LinkError>
Repoints
index at source/target, returning the previous state.Source§fn delete_link(&mut self, index: u32) -> Result<Link, LinkError>
fn delete_link(&mut self, index: u32) -> Result<Link, LinkError>
Deletes
index, returning the link that was removed.Source§fn update_link_observed(
&mut self,
index: u32,
source: u32,
target: u32,
observer: &mut dyn FnMut(Link, Link),
) -> Result<Link, LinkError>
fn update_link_observed( &mut self, index: u32, source: u32, target: u32, observer: &mut dyn FnMut(Link, Link), ) -> Result<Link, LinkError>
Source§fn delete_link_observed(
&mut self,
index: u32,
observer: &mut dyn FnMut(Link, Link),
) -> Result<Link, LinkError>
fn delete_link_observed( &mut self, index: u32, observer: &mut dyn FnMut(Link, Link), ) -> Result<Link, LinkError>
Source§fn query_links(
&self,
index: Option<u32>,
source: Option<u32>,
target: Option<u32>,
) -> Vec<Link> ⓘ
fn query_links( &self, index: Option<u32>, source: Option<u32>, target: Option<u32>, ) -> Vec<Link> ⓘ
Returns every link matching the (optional) index/source/target pattern.
Source§fn search_link(&self, source: u32, target: u32) -> Option<u32>
fn search_link(&self, source: u32, target: u32) -> Option<u32>
Finds the address of a link with the given source and target.
Source§fn get_or_create_link(
&mut self,
source: u32,
target: u32,
) -> Result<u32, LinkError>
fn get_or_create_link( &mut self, source: u32, target: u32, ) -> Result<u32, LinkError>
Returns the address of an existing
(source, target) link,
creating it when it does not exist yet.Source§fn create_link_observed(
&mut self,
source: T,
target: T,
observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>),
) -> Result<T, LinkError>
fn create_link_observed( &mut self, source: T, target: T, observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>), ) -> Result<T, LinkError>
Self::create_link, reporting every change, including partial changes
before an error. Transactions need these callbacks to distinguish a new
allocation from a duplicate resolved into an existing link. Read moreSource§fn ensure_link_created_observed(
&mut self,
index: T,
observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>),
) -> Result<T, LinkError>
fn ensure_link_created_observed( &mut self, index: T, observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>), ) -> Result<T, LinkError>
Self::ensure_link_created, reporting every placeholder it creates. Read moreSource§fn restore_link(
&mut self,
index: T,
source: T,
target: T,
) -> Result<GenericLink<T>, LinkError>
fn restore_link( &mut self, index: T, source: T, target: T, ) -> Result<GenericLink<T>, LinkError>
Writes exactly this row for undo and replay, returning the previous state. Read more
Source§fn links_count(&self) -> usize
fn links_count(&self) -> usize
Number of links currently stored.
Source§fn capture_names(&mut self) -> Result<Option<BTreeMap<T, String>>, LinkError>
fn capture_names(&mut self) -> Result<Option<BTreeMap<T, String>>, LinkError>
Optional logical name snapshot for transactional undo. Unnamed stores
return None without allocation. Include names of absent/external rows.
Source§fn set_link_name(
&mut self,
_index: T,
_name: Option<&str>,
) -> Result<T, LinkError>
fn set_link_name( &mut self, _index: T, _name: Option<&str>, ) -> Result<T, LinkError>
Changes one logical name without recording. A named adapter must restore
external-reference names even when their row currently does not exist.
Auto Trait Implementations§
impl<L> !Freeze for NamedLinksStorage<L>
impl<L> !RefUnwindSafe for NamedLinksStorage<L>
impl<L> !Sync for NamedLinksStorage<L>
impl<L> Send for NamedLinksStorage<L>where
L: Send,
impl<L> Unpin for NamedLinksStorage<L>where
L: Unpin,
impl<L> UnsafeUnpin for NamedLinksStorage<L>where
L: UnsafeUnpin,
impl<L> UnwindSafe for NamedLinksStorage<L>where
L: UnwindSafe,
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
Mutably borrows from an owned value. Read more