Struct zng_view_prebuilt::ViewLib

source ·
pub struct ViewLib { /* private fields */ }
Expand description

Dynamically linked pre-built view.

Implementations§

source§

impl ViewLib

source

pub fn install() -> Result<Self, Error>

Extract the embedded library to the temp directory and link to it.

source

pub fn uninstall() -> Result<bool, Error>

Try to delete the installed library from the temp directory.

See uninstall_from for details.

source

pub fn install_to(dir: impl Into<PathBuf>) -> Result<Self, Error>

Extract the embedded library to dir and link to it.

source

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.

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.

source

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.

source

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§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more