Why is limit u64
instead of usize
?
#2492
Replies: 1 comment
-
Thank you for your question. I assume you mean Casting is common in Rust. I do find myself casting the |
Beta Was this translation helpful? Give feedback.
-
Given that non-streaming results need to go into a
Vec
, shouldn't limit useusize
instead? If it wasusize
then it would be more convenient to compare the length of returned results versus the limit. Use case is over fetching by one to determine whether or not to return a query continuation token in an API response.For use case of streaming more than
usize
, then would it be worth it it just have a tradeoff of not specifying the limit and just dropping the stream when done determined by the client?Is there any particular reason why
u64
is used?Beta Was this translation helpful? Give feedback.
All reactions