You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,8 @@ For the Python version, please check out https://github.com/svix/python-ksuid
24
24
25
25
## What is a ksuid?
26
26
27
-
A ksuid is a K sorted UID. In other words, a KSUID also stores a date component, so that ksuids can be approximately
28
-
sorted based on the time they were created.
27
+
A ksuid is a K sorted UID. In other words, a KSUID also stores a date component, so that ksuids can be approximately
28
+
sorted based on the time they were created.
29
29
30
30
Read more [here](https://segment.com/blog/a-brief-history-of-the-uuid/).
31
31
@@ -41,7 +41,7 @@ svix-ksuid = "^0.6.0"
41
41
```rust
42
42
usesvix_ksuid::*;
43
43
44
-
letksuid=Ksuid::new(None, None);
44
+
letksuid=Ksuid::now(None);
45
45
println!("{}", ksuid.to_string());
46
46
// 1srOrx2ZWZBpBUvZwXKQmoEYga2
47
47
```
@@ -57,19 +57,22 @@ The code too is fully compatible:
57
57
```rust
58
58
usesvix_ksuid::*;
59
59
60
-
letksuid=KsuidMs::new(None, None);
60
+
letksuid=KsuidMs::now(None);
61
61
```
62
62
63
63
And they both implement the same `KsuidLike` trait.
64
64
65
65
### Opt-in features
66
66
*`serde` - adds the ability to serialize and deserialize `Ksuid` and `KsuidMs`
67
67
using serde.
68
+
*`time03` - accept timestamps as the `time::OffsetDateTime` type from the [time](https://crates.io/crates/time) (0.3.x) crate – this feature is enabled by default, for compatibility with 0.8.x and older verisons
69
+
*`chrono04` - accept timestamps as the `chrono::DateTime<chrono::Utc>` type from the [chrono](https://crates.io/crates/chrono) (0.4.x) crate
70
+
*`jiff02` - accept timestamps as the `jiff::Timestamp` type from the [jiff](https://crates.io/crates/jiff) (0.2.x) crate
68
71
69
72
Make sure to enable like this:
70
73
```toml
71
74
[dependencies]
72
-
svix-ksuid = { version = "^0.6.0", features = ["serde"] }
75
+
svix-ksuid = { version = "^0.6.0", features = ["serde", "jiff02"] }
73
76
```
74
77
75
78
## Examples
@@ -79,7 +82,7 @@ svix-ksuid = { version = "^0.6.0", features = ["serde"] }
0 commit comments