-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dev/1.0.0] ZBytes::iter
stop to the first invalid item instead of raising the error
#1077
Comments
Dmitry @yellowhatter pointed that this |
About the result size, the iterator item type is generic, so the size of the
I disagree with the conclusion of this sentence. If the function is inlined, the result will not be "returned" at each step. This function is generic, so it is inlinable cross-crate, and because it's in a iterator, I believe it will mostly be inlined. |
That's already the case because we use boxed error. Maybe there is a confusion with |
If I've understood it correctly, you are proposing for the iterator to return User code will be something like: while let Ok(Some(t)) = sample.payload().iter::<String>().next() {
// Do stuff
} If that's the case I'm fine with the proposal and @wyfo 's argument. |
Small correction, the pattern matching will be |
Correct with the pattern matching |
Anyway, a simpler solution could be to simply to let the user do the deserialization himself, and just return an iterator of |
I think it's not nice to let the user do it while we can do it with improved ergonomics. |
ZBytes::iter
stop to the first invalid item instead of raising the errorZBytes::iter
stop to the first invalid item instead of raising the error
Closed by #1120 |
Describe the release item
zenoh/zenoh/src/api/bytes.rs
Line 235 in 9bcfdc7
Iterator should yield
Result<T <ZSerde as Deserialize<'a, T>>::Error>
instead, and first yield the error, then yield None.@Mallets @milyin
The text was updated successfully, but these errors were encountered: