Struct zng_view_prebuilt::ViewLib
source · pub struct ViewLib { /* private fields */ }
Expand description
Dynamically linked pre-built view.
Implementations§
source§impl ViewLib
impl ViewLib
sourcepub fn install() -> Result<Self, Error>
pub fn install() -> Result<Self, Error>
Extract the embedded library to the temp directory and link to it.
sourcepub fn uninstall() -> Result<bool, Error>
pub fn uninstall() -> Result<bool, Error>
Try to delete the installed library from the temp directory.
See uninstall_from
for details.
sourcepub fn install_to(dir: impl Into<PathBuf>) -> Result<Self, Error>
pub fn install_to(dir: impl Into<PathBuf>) -> Result<Self, Error>
Extract the embedded library to dir
and link to it.
sourcepub fn uninstall_from(dir: impl Into<PathBuf>) -> Result<bool, Error>
pub fn uninstall_from(dir: impl Into<PathBuf>) -> Result<bool, Error>
Try to delete the installed library from the given dir
.
Returns Ok(true)
if uninstalled, Ok(false)
if was not installed and Err(_)
if is installed and failed to delete.
Note that the file is probably in use if it was installed in the current process instance, in Windows files cannot be deleted until they are released.
sourcepub fn link(view_dylib: impl Into<PathBuf>) -> Result<Self, Error>
pub fn link(view_dylib: impl Into<PathBuf>) -> Result<Self, Error>
Link to the pre-built library file.
If the file does not have an extension searches for a file without extension then a
.dll
file in Windows, a .so
file in Linux and a .dylib
file in other operating systems.
Note that the is only searched as described above, if it is not found an error returns immediately, the operating system library search feature is not used.
sourcepub fn view_process_main(self)
pub fn view_process_main(self)
Call the pre-built view_process_main
.
§Aborts
Kills the process with code 101
if there is a panic generated by the pre-built code or by threads started by the pre-build code,
this needs to happen because unwind across FFI in undefined behavior.
sourcepub fn run_same_process(self, run_app: impl FnOnce() + Send + 'static) -> !
pub fn run_same_process(self, run_app: impl FnOnce() + Send + 'static) -> !
Call the pre-build run_same_process
.
This function exits the process after run_app
returns.
§Aborts
Kills the process with code 101
if there is a panic generated by the pre-built code or by threads started by the pre-build code,
this needs to happen because unwind across FFI in undefined behavior.
Auto Trait Implementations§
impl Freeze for ViewLib
impl RefUnwindSafe for ViewLib
impl Send for ViewLib
impl Sync for ViewLib
impl Unpin for ViewLib
impl UnwindSafe for ViewLib
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more