Skip to content

Add unconditionally implemented (potentially) open-ended bounds #360

@tyilo

Description

@tyilo

I have a use-case for a function supporting both big integers and primitive integers. It would be useful to be able to get the minimum and maximum value as an Option<T> at runtime, without having to use a generic info.

Type Bounds
BigInt ..
BigUInt 0..
T: Bounded T::min_value()..=T::max_value()

This could be implemented as:

trait FiniteRange {
    fn min_value() -> Option<Self>;
    fn max_value() -> Option<Self>;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions