pub struct Library { /* private fields */ }Expand description
A handle to the Ultralight library.
Implementations§
Source§impl Library
impl Library
Sourcepub fn linked() -> Arc<Library>
Available on crate features linked or appcore_linked only.
pub fn linked() -> Arc<Library>
linked or appcore_linked only.Creates a new Library instance with linked Ultralight and AppCore (if enabled appcore_linked feature) functions.
Sourcepub unsafe fn load() -> Result<Arc<Library>, LoadingError>
Available on crate feature loaded only.
pub unsafe fn load() -> Result<Arc<Library>, LoadingError>
loaded only.Loads the Ultralight library for the current platform.
The library must be installed in the system library path, or loadable by name.
All the other related libraries (UltralightCore and WebCore) must be loadable as well.
This is preferred over linked() when the application
wants to gracefully handle the absence of the library, or handle loading it dynamically.
This doesn’t come with AppCore functions, use load_with_appcore()
if you need AppCore functions.
§Safety
dlopen native libraries is inherently unsafe. The safety guidelines
for [Library::new()][https://docs.rs/libloading/latest/libloading/struct.Library.html#method.new] and
[Library::get()][https://docs.rs/libloading/latest/libloading/struct.Library.html#method.get] apply here.
No function loaded directly or indirectly from this Library
may be called after it is dropped.
Sourcepub unsafe fn load_with_appcore() -> Result<Arc<Library>, LoadingError>
Available on crate feature loaded only.
pub unsafe fn load_with_appcore() -> Result<Arc<Library>, LoadingError>
loaded only.Loads the AppCore and Ultralight libraries for the current platform.
The libraries must be installed in the system library path, or loadable by name.
All the other related libraries (Ultralight, UltralightCore and WebCore) must be loadable as well.
This comes with all functions, Ultralight and AppCore.
If you are handling your own rendering and windowing,
you may want to use load() only instead
which doesn’t come with AppCore functions.
§Safety
dlopen native libraries is inherently unsafe. The safety guidelines
for [Library::new()][https://docs.rs/libloading/latest/libloading/struct.Library.html#method.new] and
[Library::get()][https://docs.rs/libloading/latest/libloading/struct.Library.html#method.get] apply here.
No function loaded directly or indirectly from this Library
may be called after it is dropped.
Sourcepub unsafe fn load_from<P: AsRef<OsStr>>(
ultralight_path: P,
) -> Result<Arc<Library>, LoadingError>
Available on crate feature loaded only.
pub unsafe fn load_from<P: AsRef<OsStr>>( ultralight_path: P, ) -> Result<Arc<Library>, LoadingError>
loaded only.Loads the Ultralight library from the given path/name of the library.
All the other related libraries (UltralightCore and WebCore) must be loadable as well.
§Safety
dlopen native libraries is inherently unsafe. The safety guidelines
for [Library::new()][https://docs.rs/libloading/latest/libloading/struct.Library.html#method.new] and
[Library::get()][https://docs.rs/libloading/latest/libloading/struct.Library.html#method.get] apply here.
No function loaded directly or indirectly from this Library
may be called after it is dropped.
Sourcepub unsafe fn load_from_appcore<P>(
appcore_path: P,
) -> Result<Arc<Library>, LoadingError>
Available on crate feature loaded only.
pub unsafe fn load_from_appcore<P>( appcore_path: P, ) -> Result<Arc<Library>, LoadingError>
loaded only.Loads the AppCore and Ultralight libraries from the given path/name of the library.
All the other related libraries (Ultralight, UltralightCore and WebCore) must be loadable as well.
This will load all functions, Ultralight and AppCore.
If you are handling your own rendering and windowing,
you may want to use load_from() only instead
which won’t load AppCore functions.
§Safety
dlopen native libraries is inherently unsafe. The safety guidelines
for [Library::new()][https://docs.rs/libloading/latest/libloading/struct.Library.html#method.new] and
[Library::get()][https://docs.rs/libloading/latest/libloading/struct.Library.html#method.get] apply here.
No function loaded directly or indirectly from this Library
may be called after it is dropped.