doc: update omrf docstring
This commit is contained in:
@@ -14,10 +14,16 @@
|
||||
//!
|
||||
//! # Typical usage
|
||||
//!
|
||||
//! A single instance is usually stored in a `static LazyLock` and shared across all FFI entry
|
||||
//! points. The state `S` typically aggregates the library's DLL-level resources -- for example a
|
||||
//! number of [`ObjectPool`](crate::object_pool::ObjectPool)s and other globals that must be
|
||||
//! constructed on first startup and torn down on last shutdown.
|
||||
//! A single [`LibraryLifecycle`] instance is usually stored in a `static LazyLock` and shared
|
||||
//! across all FFI entry points. The state `S` aggregates the library's DLL-level resources -- for
|
||||
//! example a number of [`ObjectPool`](crate::object_pool::ObjectPool)s and other globals.
|
||||
//!
|
||||
//! 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
|
||||
//!
|
||||
|
||||
Reference in New Issue
Block a user