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 new link and returns its address.
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 links_count(&self) -> usize
fn links_count(&self) -> usize
Number of links currently stored.
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>
impl<L> Unpin for NamedLinksStorage<L>
impl<L> UnsafeUnpin for NamedLinksStorage<L>where
RefCell<L>: UnsafeUnpin,
impl<L> UnwindSafe for NamedLinksStorage<L>where
RefCell<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