MCPcopy Create free account
hub / github.com/Shizcow/hotpatch / hotpatch_lib

Method hotpatch_lib

hotpatch/src/docs.rs:88–90  ·  view source on GitHub ↗

Hotpatch this functor with functionality defined in `lib_name`. Will search a shared object `cdylib` file for [`#[patch]`](crate::patch) exports, finding the definition that matches module path and signature. ## Example ``` #[patchable] fn foo() {} fn main() -> Result<(), Box > { foo(); // does something foo.hotpatch_lib("libtest.so")?; foo(); // does something else Ok(())

(&self, lib_name: &str)

Source from the content-addressed store, hash-verified

86 /// appear to be defined, compile `hotpatch` with the `large-signatures` feature
87 /// to increase the number of supported arguements.
88 pub fn hotpatch_lib(&self, lib_name: &str) -> Result<(), Box<dyn std::error::Error + '_>> {
89 // The actual implementation is in toplevel
90 }
91 /// Like [`hotpatch_lib`](crate::Patchable::hotpatch_lib) but uses
92 /// [`RwLock::try_write`](https://doc.rust-lang.org/std/sync/struct.RwLock.html#method.try_write).
93 pub fn try_hotpatch_lib(&self, lib_name: &str) -> Result<(), Box<dyn std::error::Error + '_>> {

Callers 4

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected