Struct dusk_api::FreightProxy [−][src]
A structure, that contains a Freight object and is used to import and use it safely
This structure is a Freight
trait implementor and
FreightRegistrar
trait implementor. It provides
FreightProxy::load
function that is used to build the
FreightProxy
from a library path
To learn more about the functions you may call on the
FreightProxy
, see Freight
trait documentation
Example
let mut my_f_proxy: FreightProxy = unsafe{ FreightProxy::load("/bin/libtest_plug.so").expect("fail") }; println!("{}, {}", my_f_proxy.name, my_f_proxy.version); let fnlist: Vec<Function> = my_f_proxy.get_function_list(); for func in fnlist { println!("{}, {}", func.name, func.number); }
Fields
freight: Box<dyn Freight>
Imported freight, solely for internal purposes
lib: Rc<Library>
Lib this freight was imported from to make sure this structure does not outlive the library it was imported from
name: &'static str
Imported freights name as a static string
version: &'static str
Imported freights version as a static string
Implementations
impl FreightProxy
[src]
Functions, needed to configure FreightProxy
structure
initially
pub unsafe fn load(lib_path: &str) -> Result<FreightProxy, RuntimeError>
[src]
Function, used to build a FreightProxy
object from a
library path
Trait Implementations
impl Freight for FreightProxy
[src]
fn call_function(
&mut self,
function_number: u64,
args: Vec<&mut Box<dyn Any>>
) -> Result<Box<dyn Any>, RuntimeError>
[src]
&mut self,
function_number: u64,
args: Vec<&mut Box<dyn Any>>
) -> Result<Box<dyn Any>, RuntimeError>
fn init(
&mut self,
limitations: &Option<Vec<Limitation>>
) -> Vec<InterplugRequest>
[src]
&mut self,
limitations: &Option<Vec<Limitation>>
) -> Vec<InterplugRequest>
fn update_limitations(&mut self, limitations: &Vec<Limitation>)
[src]
fn interplug_provide(
&mut self,
request: InterplugRequest,
freight_proxy: Rc<FreightProxy>
)
[src]
&mut self,
request: InterplugRequest,
freight_proxy: Rc<FreightProxy>
)
fn interplug_deny(&mut self, request: InterplugRequest)
[src]
fn get_function_list(&mut self) -> Vec<Function>
[src]
fn get_type_list(&mut self) -> Vec<Type>
[src]
fn get_operator_list(&mut self) -> Vec<Function>
[src]
impl FreightRegistrar for FreightProxy
[src]
fn register_freight(&mut self, freight: Box<dyn Freight>)
[src]
Auto Trait Implementations
impl !RefUnwindSafe for FreightProxy
[src]
impl !Send for FreightProxy
[src]
impl !Sync for FreightProxy
[src]
impl Unpin for FreightProxy
[src]
impl !UnwindSafe for FreightProxy
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,