pub trait DecoratorsExt<T: LinkReference>: Doublets<T> + Sized {
Show 13 methods
// Provided methods
fn with_transactions<J: TransitionLog<T>>(
self,
journal: J,
) -> Result<TransactionsDecorator<T, Self, J>, Error<T>> { ... }
fn with_uniqueness<P: UniquenessPolicy>(
self,
_policy: P,
) -> P::Decorator<T, Self> { ... }
fn with_usages<P: UsagesPolicy>(self, _policy: P) -> P::Decorator<T, Self> { ... }
fn with_usages_validation(self) -> UsagesValidator<T, Self> { ... }
fn with_cascade_usages_resolution(self) -> CascadeUsagesResolver<T, Self> { ... }
fn with_inner_reference_existence_validation(
self,
) -> InnerReferenceExistenceValidator<T, Self> { ... }
fn with_non_existent_dependencies_creation(
self,
) -> NonExistentDependenciesCreator<T, Self> { ... }
fn with_itself_constant_resolution(
self,
) -> ItselfConstantToSelfReferenceResolver<T, Self> { ... }
fn with_null_constant_resolution(
self,
) -> NullConstantToSelfReferenceResolver<T, Self> { ... }
fn with_non_null_contents_deletion_resolution(
self,
) -> NonNullContentsLinkDeletionResolver<T, Self> { ... }
fn with_logging<W: Write + Send + Sync>(
self,
writer: W,
) -> LoggingDecorator<T, Self, W> { ... }
fn with_no_exceptions(self) -> NoExceptionsDecorator<T, Self> { ... }
fn with_automatic_uniqueness_and_usages_resolution(
self,
) -> AutomaticUniquenessAndUsagesResolution<T, Self> { ... }
}Expand description
Composes decorators around a store.
Every method takes the store by value and returns the concrete composed type, so a stack is built at compile time and every layer is a candidate for inlining:
use doublets::{decorators::{DecoratorsExt, Resolve}, mem, unit, Doublets};
let mut store = unit::Store::<usize, _>::new(mem::Global::new())?
.with_uniqueness(Resolve)
.with_usages_validation();
let a = store.create_point()?;
let b = store.create_point()?;
// The second `create_link` reuses the first one instead of storing a duplicate.
assert_eq!(store.create_link(a, b)?, store.create_link(a, b)?);Provided Methods§
Sourcefn with_transactions<J: TransitionLog<T>>(
self,
journal: J,
) -> Result<TransactionsDecorator<T, Self, J>, Error<T>>
fn with_transactions<J: TransitionLog<T>>( self, journal: J, ) -> Result<TransactionsDecorator<T, Self, J>, Error<T>>
Wraps the store in TransactionsDecorator and recovers its journal.
Sourcefn with_uniqueness<P: UniquenessPolicy>(
self,
_policy: P,
) -> P::Decorator<T, Self>
fn with_uniqueness<P: UniquenessPolicy>( self, _policy: P, ) -> P::Decorator<T, Self>
Applies a UniquenessPolicy — Validate,
Resolve or CascadeResolve.
Sourcefn with_usages<P: UsagesPolicy>(self, _policy: P) -> P::Decorator<T, Self>
fn with_usages<P: UsagesPolicy>(self, _policy: P) -> P::Decorator<T, Self>
Applies a UsagesPolicy — Validate or
CascadeResolve.
Sourcefn with_usages_validation(self) -> UsagesValidator<T, Self>
fn with_usages_validation(self) -> UsagesValidator<T, Self>
Wraps in UsagesValidator.
Sourcefn with_cascade_usages_resolution(self) -> CascadeUsagesResolver<T, Self>
fn with_cascade_usages_resolution(self) -> CascadeUsagesResolver<T, Self>
Wraps in CascadeUsagesResolver.
Sourcefn with_inner_reference_existence_validation(
self,
) -> InnerReferenceExistenceValidator<T, Self>
fn with_inner_reference_existence_validation( self, ) -> InnerReferenceExistenceValidator<T, Self>
Wraps in InnerReferenceExistenceValidator.
Sourcefn with_non_existent_dependencies_creation(
self,
) -> NonExistentDependenciesCreator<T, Self>
fn with_non_existent_dependencies_creation( self, ) -> NonExistentDependenciesCreator<T, Self>
Wraps in NonExistentDependenciesCreator.
Sourcefn with_itself_constant_resolution(
self,
) -> ItselfConstantToSelfReferenceResolver<T, Self>
fn with_itself_constant_resolution( self, ) -> ItselfConstantToSelfReferenceResolver<T, Self>
Wraps in ItselfConstantToSelfReferenceResolver.
Sourcefn with_null_constant_resolution(
self,
) -> NullConstantToSelfReferenceResolver<T, Self>
fn with_null_constant_resolution( self, ) -> NullConstantToSelfReferenceResolver<T, Self>
Wraps in NullConstantToSelfReferenceResolver.
Sourcefn with_non_null_contents_deletion_resolution(
self,
) -> NonNullContentsLinkDeletionResolver<T, Self>
fn with_non_null_contents_deletion_resolution( self, ) -> NonNullContentsLinkDeletionResolver<T, Self>
Wraps in NonNullContentsLinkDeletionResolver.
Sourcefn with_logging<W: Write + Send + Sync>(
self,
writer: W,
) -> LoggingDecorator<T, Self, W>
fn with_logging<W: Write + Send + Sync>( self, writer: W, ) -> LoggingDecorator<T, Self, W>
Wraps in LoggingDecorator, logging every mutation to writer.
Sourcefn with_no_exceptions(self) -> NoExceptionsDecorator<T, Self>
fn with_no_exceptions(self) -> NoExceptionsDecorator<T, Self>
Wraps in NoExceptionsDecorator.
Sourcefn with_automatic_uniqueness_and_usages_resolution(
self,
) -> AutomaticUniquenessAndUsagesResolution<T, Self>
fn with_automatic_uniqueness_and_usages_resolution( self, ) -> AutomaticUniquenessAndUsagesResolution<T, Self>
Builds the same stack as C#
ILinksExtensions.DecorateWithAutomaticUniquenessAndUsagesResolution:
CascadeUsagesResolver innermost, then NonNullContentsLinkDeletionResolver,
then CascadeUniquenessAndUsagesResolver outermost.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".