1
Fork 0
mirror of https://github.com/RGBCube/bonfire.v synced 2025-07-28 14:37:44 +00:00

Add snowflake_holder.v

This commit is contained in:
RGBCube 2022-12-16 22:30:51 +03:00
parent bb2031ff05
commit e7ae4727da

13
src/snowflake_holder.v Normal file
View file

@ -0,0 +1,13 @@
module bonfire
// SnowflakeHolder is a small util class that holds a single snowflake.
// Useful because all Discord objects have a field named ID.
[noinit]
pub struct SnowflakeHolder {
id Snowflake
}
// created_at returns the time the snowflake was created.
fn (sh SnowflakeHolder) created_at() Time {
return sh.id.created_at()
}