Trait DelegateVirtualStaticBound

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

Delegates bound resolution to an external VirtualStaticBound provider.

This trait is used when a type participates in a VirtualStaticField 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 compile-time constant (usize), enabling fully static, zero-overhead representations.

§Roles

  • Container (Self)

    • provides storage for the field
  • Bounds (Provider)

    • supplies compile-time 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 statically 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> DelegateVirtualStaticBound<Provider, Discriminant> for T
where Provider: VirtualStaticBound<Discriminant>, Discriminant: DiscriminantTag, T: Sized,

Blanket implementation enabling all types to delegate static bound resolution to a VirtualStaticBound provider.