impl_validated_constructors

Macro impl_validated_constructors 

Source
macro_rules! impl_validated_constructors {
    ($StructName:ident, $PolicyType:ident, $RawType:ident) => { ... };
}
Expand description

Implements constructor traits and methods: TryNewValidated, TryNew, new() (deprecated), new_unchecked().

  • TryNewValidated: Always validates (from try_create crate)
  • TryNew: Alias for TryNewValidated (from try_create crate)
  • new(): DEPRECATED - Always validates and panics on failure. Use try_new() instead.
  • new_unchecked(): UNSAFE - Validates only in debug builds, zero-cost in release.

§Example

impl_validated_constructors!(MyType, RealPolicy, RawReal);