doc: update omrf docstring

This commit is contained in:
2026-08-14 13:37:41 +08:00
parent 8664c24343
commit d7e92d588f
+10 -4
View File
@@ -14,10 +14,16 @@
//! //!
//! # Typical usage //! # Typical usage
//! //!
//! A single instance is usually stored in a `static LazyLock` and shared across all FFI entry //! A single [`LibraryLifecycle`] instance is usually stored in a `static LazyLock` and shared
//! points. The state `S` typically aggregates the library's DLL-level resources -- for example a //! across all FFI entry points. The state `S` aggregates the library's DLL-level resources -- for
//! number of [`ObjectPool`](crate::object_pool::ObjectPool)s and other globals that must be //! example a number of [`ObjectPool`](crate::object_pool::ObjectPool)s and other globals.
//! constructed on first startup and torn down on last shutdown. //!
//! Reach for [`LibraryLifecycle`] only when acquiring those resources **can fail** and you want to
//! surface that failure to the caller explicitly through the `startup` / `shutdown` functions. When
//! resource construction is infallible (or its failure need not be reported), a plain
//! `static LazyLock<S>` is sufficient -- it lazily initializes `S` as the DLL loads, with no
//! lifecycle machinery required. Collecting the library's state into a single `S` struct is
//! recommended either way.
//! //!
//! # Call order //! # Call order
//! //!