pub struct LcBarContext<'a, T> {
pub lc: &'a LeechCore,
pub ctxlock: RwLock<T>,
/* private fields */
}Expand description
PCIe BAR Context: Supplied by LeechCore to the BAR callback function.
Contains the lc field which gives access to the general API.
Contains the ctxlock field which gives access to the user-defined generic
struct set at plugin initialization.
The ctxlock field is a std::sync::RwLock and the inner user-defined
generic struct may be accessed in either multi-threaded read-mode or
single-threaded mutable write-mode. Read mode is more efficient.
See the plugin example for additional use cases and documentation.
Only one BAR callback may be active at a given time for a given native LeechCore instance. Previous instances will become inactive if a new one is started. To inactivate a callback drop the context.
§Created By
LeechCore::pcie_bar_callback()
Fields§
§lc: &'a LeechCoreAccess the general LeechCore API through the lc field.
ctxlock: RwLock<T>Access generic user-set plugin context in a thread-safe way.