Lines Matching refs:Library

58 /// The platform-specific counterpart of the cross-platform [`Library`](crate::Library).
59 pub struct Library(HMODULE);
61 unsafe impl Send for Library {}
64 // say for sure whether the Win32 APIs used to implement `Library` are thread-safe or not.
75 unsafe impl Sync for Library {}
77 impl Library {
89 /// This is equivalent to <code>[Library::load_with_flags](filename, 0)</code>.
104 pub unsafe fn new<P: AsRef<OsStr>>(filename: P) -> Result<Library, crate::Error> {
105 Library::load_with_flags(filename, 0)
108 /// Get the `Library` representing the original program executable.
110 /// Note that the behaviour of the `Library` loaded with this method is different from
111 /// Libraries loaded with [`os::unix::Library::this`]. For more information refer to [MSDN].
115 /// [`os::unix::Library::this`]: crate::os::unix::Library::this
117 pub fn this() -> Result<Library, crate::Error> {
125 Some(Library(handle))
133 /// This function returns a `Library` corresponding to a module with the given name that is
148 pub fn open_already_loaded<P: AsRef<OsStr>>(filename: P) -> Result<Library, crate::Error> {
160 Some(Library(handle))
172 /// See [`Library::new`] for documentation on the handling of the `filename` argument. See the
189 pub unsafe fn load_with_flags<P: AsRef<OsStr>>(filename: P, flags: DWORD) -> Result<Library, crate::Error> {
201 Some(Library(handle))
257 /// Convert the `Library` to a raw handle.
264 /// Convert a raw handle to a `Library`.
270 /// `Library::into_raw` call.
271 pub unsafe fn from_raw(handle: HMODULE) -> Library {
272 Library(handle)
278 /// library is unloaded. Otherwise this will be done when `Library` is dropped.
297 impl Drop for Library {
303 impl fmt::Debug for Library {
312 f.write_str(&format!("Library@{:p}", self.0))
318 f.write_str(&format!("Library@{:p} from {:?}", self.0, string))
327 /// `Symbol` does not outlive the `Library` that it comes from.
433 /// functions like [`Library::get`] with this DLL. Using this value causes writes to read-only