num-traits icon indicating copy to clipboard operation
num-traits copied to clipboard

Exclusively increasing?

Open cheako opened this issue 3 years ago • 3 comments

Hello, I was looking for a type that could only ever increase. Useful for the CPU side of Vulkan's Timeline Semaphores. I know I could trivially implement this, I was just wondering if this is something one of the num crates would be interested in including?

cheako avatar Nov 20 '22 18:11 cheako

It doesn't sound like a trait, at least, until there are multiple types with this characteristic and a need to be generic over those types. Then if a 3rd party crate is defining such types, it probably makes sense to define its own trait too.

My sense is that your idea would be quite domain specific, especially when getting into details like thread-safety and overflow behavior, so it doesn't seem like something that I would put in a generic num crate.

cuviper avatar Nov 21 '22 17:11 cuviper

By the sound of this, we are on the same page WRGT the type and traits and how they would function. I did understand that num-traits wasn't the exact crate these would belong. Is there a number utility crate where this might live, where might I seek this addition? Creation of a new crate?

I'm guessing there are less than a handful of implementations for this and even though my domain would only use one, implementing all of them wouldn't seem a waste at all.

cheako avatar Nov 21 '22 18:11 cheako

I don't think there's a natural place for this, at least not in the crates in this org. Maybe you'd like to publish your own crate for it?

cuviper avatar Nov 21 '22 18:11 cuviper