pub trait NodeData: Sized {
type Error;
type CacheAcceptor: CacheAcceptor<Self>;
// Required method
fn dedup(&mut self) -> Either<Node<Self>, Self::CacheAcceptor>;
// Provided method
fn backlink(
&mut self,
_backlink: Backlink<'_, Self>,
) -> Result<(), Self::Error> { ... }
}
Expand description
A trait implemented by items which can be placed into a node, but may require a node backlink
Required Associated Types§
Sourcetype CacheAcceptor: CacheAcceptor<Self>
type CacheAcceptor: CacheAcceptor<Self>
An acceptor for cache entries
Required Methods§
Sourcefn dedup(&mut self) -> Either<Node<Self>, Self::CacheAcceptor>
fn dedup(&mut self) -> Either<Node<Self>, Self::CacheAcceptor>
Attempt to deduplicate this NodeData
, either succeeding or returning a cache entry
to place the newly created node in should backlinking succeed.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.