make use of Uuid crate and integer parsing values like room-id
Retoon opened this issue · 2 comments
From what i understand, things like room-id and user-id are all integers wrapped around strings, i propose to parse these strings to some primitive integer type.
twitch message id
s are 128bit UUIDs, it would be nice to use the uuid
crate and parse these into the Uuid
type, as they have some nice features and still allow the end user to return them as a String in the future. It is mainly useful for when you want to store something in a database with for example sqlx
and postgres
because they bind the Uuid
type to uuid columns in the database.
If this is something you guys agree would be useful it should probably be implemented before #187 because it also involves uuids
Edits: fixing many small mistakes
I'm not very keen on doing this. Twitch never says that these have to be numbers/UUIDs, and in fact they have demonstrated in the past that this is on purpose, when emotesv2 became a thing and suddenly, emote IDs were no longer strictly numeric. I've tried to implement as little undocumented behaviour in this library as possible to ensure its stability, and I think I'd like to keep it that way.
They've also consistently made user IDs strings in the Helix API (when they could easily have been numbers too), so I'd like to think that this is very much on purpose.
fair point. 👍
Now that you mention it, their spec indeed doesn't have any concrete anything. It's all just loosely defined, i guess i looked over that part.