Library

Struct Library 

Source
pub struct Library { /* private fields */ }
Expand description

A handle to the Ultralight library.

Implementations§

Source§

impl Library

Source

pub fn linked() -> Arc<Library>

Available on crate features linked or appcore_linked only.

Creates a new Library instance with linked Ultralight and AppCore (if enabled appcore_linked feature) functions.

Source

pub unsafe fn load() -> Result<Arc<Library>, LoadingError>

Available on crate feature 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.

Source

pub unsafe fn load_with_appcore() -> Result<Arc<Library>, LoadingError>

Available on crate feature 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.

Source

pub unsafe fn load_from<P: AsRef<OsStr>>( ultralight_path: P, ) -> Result<Arc<Library>, LoadingError>

Available on crate feature 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.

Source

pub unsafe fn load_from_appcore<P>( appcore_path: P, ) -> Result<Arc<Library>, LoadingError>
where P: AsRef<OsStr>,

Available on crate feature 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.

Source§

impl Library

Source

pub fn version(&self) -> Version

Get the current version of the Ultralight library.

Source

pub fn webkit_version(&self) -> String

Get the full WebKit version string

Trait Implementations§

Source§

impl Clone for Library

Source§

fn clone(&self) -> Library

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.