Trait DelegateVirtualDynBound

Source
pub trait DelegateVirtualDynBound<Provider, Discriminant = ()>
where Provider: VirtualDynBound<Discriminant>, Discriminant: DiscriminantTag, Self: Sized,
{ }
Expand description

Delegates bound resolution to an external VirtualDynBound provider.

This trait is used when a type participates in a VirtualDynField but does not define or own its bounds.

Instead, bounds are supplied externally via Provider, allowing constraints (such as capacity) to be defined independently of the field or its storage.

§Representation

The delegated bound is a runtime-resolved value (via [Get<u32>]), enabling flexible, dynamically bounded behavior.

§Roles

  • Container (Self)

    • provides storage for the field
  • Bounds (Provider)

    • supplies constraints for that field

This separation enables:

  • composability
  • reuse across contexts
  • decoupling of storage and constraints

§Default Discriminant

  • Discriminant = (): delegates a single default bound, meaning one dynamically bounded field is assumed.

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.

Implementors§

Source§

impl<Provider, Discriminant, T> DelegateVirtualDynBound<Provider, Discriminant> for T
where Provider: VirtualDynBound<Discriminant>, Discriminant: DiscriminantTag, T: Sized,

Blanket implementation enabling all types to delegate dynamic bound resolution to a VirtualDynBound provider.