pub fn from_file<P: AsRef<OsStr>>(filename: P, binding_name: Option<String>) -> Result<Self> {
        type PluginCreate = unsafe fn() -> *mut dyn CapabilityProvider;

        let library = Library::new(filename.as_ref())?;

        let plugin = unsafe {
            let constructor: Symbol<PluginCreate> = library.get(b"__capability_provider_create")?;
            let boxed_raw = constructor();

            Box::from_raw(boxed_raw)
        };
        info!(
            "Loaded capability: {}, native provider: {}",
            plugin.capability_id(),
            plugin.name()
        );

        let capid = plugin.capability_id().to_string();
        Ok(NativeCapability {
            capid,
            plugin,
            binding_name: binding_name.unwrap_or("default".to_string()),
            library: Some(library),
        })
    }
/// Reads a capability provider from a file. The capability provider must implement the
/// correct FFI interface to support waSCC plugins. See [wascc.dev](https://wascc.dev) for
/// documentation and tutorials on how to create a native capability provider
Reads a capability provider from a file. The capability provider must implement the
correct FFI interface to support waSCC plugins. See [wascc.dev] for
documentation and tutorials on how to create a native capability provider
Reads a capability provider from a file . The capability provider must implement the correct FFI interface to support waSCC plugins . See [ wascc . dev ] for documentation and tutorials on how to create a native capability provider
pub fn from_file<P: AsRef<OsStr>>(filename: P, binding_name: Option<String>) -> Result<Self> {
        type PluginCreate = unsafe fn() -> *mut dyn CapabilityProvider;
        let library = Library::new(filename.as_ref())?;
        let plugin = unsafe {
            let constructor: Symbol<PluginCreate> = library.get(b"__capability_provider_create")?;
            let boxed_raw = constructor();
            Box::from_raw(boxed_raw)
        };
        info!(
            "Loaded capability: {}, native provider: {}",
            plugin.capability_id(),
            plugin.name()
        );
        let capid = plugin.capability_id().to_string();
        Ok(NativeCapability {
            capid,
            plugin,
            binding_name: binding_name.unwrap_or("default".to_string()),
            library: Some(library),
        })
    }
pub fn from_file < P : AsRef < OsStr > > ( filename : P , binding_name : Option < String > ) -> Result < Self > { type PluginCreate = unsafe fn ( ) -> * mut dyn CapabilityProvider ; let library = Library :: new ( filename . as_ref ( ) ) ? ; let plugin = unsafe { let constructor : Symbol < PluginCreate > = library . get ( b" " ) ? ; let boxed_raw = constructor ( ) ; Box :: from_raw ( boxed_raw ) } ; info ! ( " " plugin capability_id ( ) plugin name ( ) ) ; let capid = plugin . capability_id ( ) . to_string ( ) ; Ok ( NativeCapability { capid , plugin , binding_name : binding_name . unwrap_or ( " " . to_string ( ) ) , library : Some ( library ) , } ) }
Reads a capability provider from a file.
Reads a capability provider from a file .
filename
P
binding_name
Option<String>
filename
P
binding_name
Option<String>