pub fn from_archive(
        archive: &ProviderArchive,
        binding_target_name: Option<String>,
    ) -> Result<Self> {
        if archive.claims().is_none() {
            return Err("No claims found in provider archive file".into());
        }
        let binding = binding_target_name.unwrap_or("default".to_string());

        let target = Host::native_target();

        match archive.target_bytes(&target) {
            Some(bytes) => Ok(NativeCapability {
                claims: archive.claims().unwrap(),
                binding_name: binding,
                native_bytes: Some(bytes),
                plugin: None,
            }),
            None => Err(format!(
                "No binary found in archive for target {}",
                Host::native_target()
            )
            .into()),
        }
    }
/// Reads a capability provider from an archive file. The right architecture/OS plugin
/// library will be chosen from the file, or an error will result if it isn't found.
Reads a capability provider from an archive file. The right architecture/OS plugin
library will be chosen from the file, or an error will result if it isn't found.
Reads a capability provider from an archive file . The right architecture / OS plugin library will be chosen from the file or an error will result if it isn ' t found .
pub fn from_archive(
        archive: &ProviderArchive,
        binding_target_name: Option<String>,
    ) -> Result<Self> {
        if archive.claims().is_none() {
            return Err("No claims found in provider archive file".into());
        }
        let binding = binding_target_name.unwrap_or("default".to_string());
        let target = Host::native_target();
        match archive.target_bytes(&target) {
            Some(bytes) => Ok(NativeCapability {
                claims: archive.claims().unwrap(),
                binding_name: binding,
                native_bytes: Some(bytes),
                plugin: None,
            }),
            None => Err(format!(
                "No binary found in archive for target {}",
                Host::native_target()
            )
            .into()),
        }
    }
pub fn from_archive ( archive : & ProviderArchive , binding_target_name : Option < String > , ) -> Result < Self > { if archive . claims ( ) . is_none ( ) { return Err ( " " . into ( ) ) ; } let binding = binding_target_name . unwrap_or ( " " . to_string ( ) ) ; let target = Host :: native_target ( ) ; match archive . target_bytes ( & target ) { Some ( bytes ) => Ok ( NativeCapability { claims : archive . claims ( ) . unwrap ( ) , binding_name : binding , native_bytes : Some ( bytes ) , plugin : None , } ) , None => Err ( format ! ( " " Host native_target ( ) ) . into ( ) ) , } }
Reads a capability provider from an archive file.
Reads a capability provider from an archive file .
archive
&ProviderArchive
binding_target_name
Option<String>
archive
&ProviderArchive
binding_target_name
Option<String>