Skip to content

Commit 22dc45e

Browse files
committed
minor docs
1 parent 61ae2cc commit 22dc45e

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/codes_handle/mod.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,17 @@ impl<D: Debug> HandleGenerator for CodesFile<D> {
5050
/// - From GRIB index using [`new_from_index()`](CodesHandle::new_from_index) (with `experimental_index` feature enabled)
5151
///
5252
/// Destructor for this structure does not panic, but some internal functions may rarely fail
53-
/// leading to bugs. Errors encountered in the destructor are logged with [`log`].
53+
/// leading to bugs. Errors encountered in the destructor are logged with [`tracing`].
5454
///
55-
/// # `FallibleStreamingIterator`
55+
/// # `FallibleIterator`
5656
///
57-
/// This structure implements [`FallibleStreamingIterator`](crate::FallibleStreamingIterator) trait which allows to access GRIB messages.
57+
/// This structure implements [`FallibleIterator`](crate::FallibleStreamingIterator) trait which allows to access GRIB messages.
5858
///
5959
/// To access GRIB messages the ecCodes library uses a method similar to a C-style iterator.
6060
/// It digests the `* FILE` multiple times, each time returning the `*mut codes_handle`
61-
/// to a message inside the file. The behavior of previous `*mut codes_handle` after next one is generated is undefined
62-
/// and we assume here that it is unsafe to use "old" `*mut codes_handle`.
61+
/// to a message inside the file.
6362
///
64-
/// In Rust, such pattern is best represented by a streaming iterator which returns a reference to the message,
65-
/// that is valid only until the next iteration. If you need to prolong the lifetime of the message, you can clone it.
66-
/// Internal ecCodes functions can fail, necessitating the streaming iterator to be implemented with
67-
/// [`FallibleStreamingIterator`](crate::FallibleStreamingIterator) trait.
68-
///
69-
/// As of `0.10` release, none of the available streaming iterator crates utilises already stabilized GATs.
70-
/// This unfortunately significantly limits the number of methods available for `CodesHandle` iterator.
71-
/// Therefore the probably most versatile way to iterate over the messages is to use `while let` loop.
63+
/// This behaviour is represented in this crate by `FallibleIterator`, because generating `KeyedMessage` can fail.
7264
///
7365
/// ```
7466
/// use eccodes::{ProductKind, CodesHandle, KeyRead};

0 commit comments

Comments
 (0)