Lines Matching refs:Library
15 pub struct Library(imp::Library);
17 impl Library {
52 /// the platform specific [`os::unix::Library::new`] and [`os::windows::Library::new`] methods
58 /// [`os::unix::Library::new`]: crate::os::unix::Library::new
59 /// [`os::windows::Library::new`]: crate::os::windows::Library::new
75 /// # use ::libloading::Library;
78 /// let _ = Library::new("/path/to/awesome.module").unwrap();
79 /// let _ = Library::new("../awesome.module").unwrap();
80 /// let _ = Library::new("libsomelib.so.1").unwrap();
83 pub unsafe fn new<P: AsRef<OsStr>>(filename: P) -> Result<Library, Error> {
84 imp::Library::new(filename).map(From::from)
108 /// consider using the [`os::unix::Library::get_singlethreaded`] call.
110 /// [`os::unix::Library::get_singlethreaded`]: crate::os::unix::Library::get_singlethreaded
117 /// # use ::libloading::Library;
119 /// Library::new("/path/to/awesome.module").unwrap()
126 /// # use ::libloading::{Library, Symbol};
128 /// # Library::new("/path/to/awesome.module").unwrap()
140 /// # use ::libloading::{Library, Symbol};
141 /// # let lib = unsafe { Library::new("/path/to/awesome.module").unwrap() };
153 /// This method might be a no-op, depending on the flags with which the `Library` was opened,
157 /// library is unloaded. Otherwise the implementation of `Drop` for `Library` will close the
166 impl fmt::Debug for Library {
172 impl From<imp::Library> for Library {
173 fn from(lib: imp::Library) -> Library {
174 Library(lib)
178 impl From<Library> for imp::Library {
179 fn from(lib: Library) -> imp::Library {
184 unsafe impl Send for Library {}
185 unsafe impl Sync for Library {}
189 /// This type is a safeguard against using dynamically loaded symbols after a `Library` is
190 /// unloaded. The primary method to create an instance of a `Symbol` is via [`Library::get`].
195 /// [`Library::get`]: Library::get
208 /// ensure the resulting `Symbol` is not used past the lifetime of the `Library` this symbol
214 /// # use ::libloading::{Library, Symbol};
216 /// let lib = Library::new("/path/to/awesome.module").unwrap();
237 /// # use ::libloading::{Library, Symbol};
239 /// let lib = Library::new("/path/to/awesome.module").unwrap();
260 /// # use ::libloading::{Library, Symbol};
262 /// let lib = Library::new("/path/to/awesome.module").unwrap();