pub fn new(
        env: &Environment,
        sgx: &SgxEnvironment,
        enclave_name: &str,
        staticlib_dir: &Path,
    ) -> Result<Self, Error> {
        // Collect metadata about dependencies of enclave
        let mut features_vec = Vec::new();
        if sgx.sgx_mode() == SgxMode::Simulation {
            features_vec.push("sgx-sim".to_owned());
        }
        if sgx.ias_mode() == IasMode::Development {
            features_vec.push("ias-dev".to_owned());
        }

        let staticlib = MetadataCommand::new()
            .cargo_path(env.cargo())
            .current_dir(staticlib_dir)
            .features(CargoOpt::SomeFeatures(features_vec))
            .exec()?;

        Ok(Self {
            cargo_builder: CargoBuilder::new(&env, staticlib_dir, false),
            config_builder: ConfigBuilder::default(),
            name: enclave_name.to_owned(),
            staticlib,
            signer: SgxSign::new(&sgx),
            out_dir: env.out_dir().to_owned(),
            target_dir: env.target_dir().to_owned(),
            profile_target_dir: env.profile_target_dir().to_owned(),
            profile: env.profile().to_owned(),
            libdir: sgx.libdir().to_owned(),
            linker: env.linker().to_owned(),
            sgx_mode: sgx.sgx_mode(),
            css: None,
            dump: None,
            signed_enclave: None,
            config_xml: None,
            unsigned_enclave: None,
            pubkey: None,
            privkey: None,
            gendata: None,
            signature: None,
            lds: None,
        })
    }
/// Construct a new enclave builder class, using the given paths.
Construct a new enclave builder class, using the given paths.
Construct a new enclave builder class using the given paths .
pub fn new(
        env: &Environment,
        sgx: &SgxEnvironment,
        enclave_name: &str,
        staticlib_dir: &Path,
    ) -> Result<Self, Error> {
        // Collect metadata about dependencies of enclave
        let mut features_vec = Vec::new();
        if sgx.sgx_mode() == SgxMode::Simulation {
            features_vec.push("sgx-sim".to_owned());
        }
        if sgx.ias_mode() == IasMode::Development {
            features_vec.push("ias-dev".to_owned());
        }
        let staticlib = MetadataCommand::new()
            .cargo_path(env.cargo())
            .current_dir(staticlib_dir)
            .features(CargoOpt::SomeFeatures(features_vec))
            .exec()?;
        Ok(Self {
            cargo_builder: CargoBuilder::new(&env, staticlib_dir, false),
            config_builder: ConfigBuilder::default(),
            name: enclave_name.to_owned(),
            staticlib,
            signer: SgxSign::new(&sgx),
            out_dir: env.out_dir().to_owned(),
            target_dir: env.target_dir().to_owned(),
            profile_target_dir: env.profile_target_dir().to_owned(),
            profile: env.profile().to_owned(),
            libdir: sgx.libdir().to_owned(),
            linker: env.linker().to_owned(),
            sgx_mode: sgx.sgx_mode(),
            css: None,
            dump: None,
            signed_enclave: None,
            config_xml: None,
            unsigned_enclave: None,
            pubkey: None,
            privkey: None,
            gendata: None,
            signature: None,
            lds: None,
        })
    }
pub fn new ( env : & Environment , sgx : & SgxEnvironment , enclave_name : & str , staticlib_dir : & Path , ) -> Result < Self , Error > { // Collect metadata about dependencies of enclave let mut features_vec = Vec :: new ( ) ; if sgx . sgx_mode ( ) == SgxMode :: Simulation { features_vec . push ( " " . to_owned ( ) ) ; } if sgx . ias_mode ( ) == IasMode :: Development { features_vec . push ( " " . to_owned ( ) ) ; } let staticlib = MetadataCommand :: new ( ) . cargo_path ( env . cargo ( ) ) . current_dir ( staticlib_dir ) . features ( CargoOpt :: SomeFeatures ( features_vec ) ) . exec ( ) ? ; Ok ( Self { cargo_builder : CargoBuilder :: new ( & env , staticlib_dir , false ) , config_builder : ConfigBuilder :: default ( ) , name : enclave_name . to_owned ( ) , staticlib , signer : SgxSign :: new ( & sgx ) , out_dir : env . out_dir ( ) . to_owned ( ) , target_dir : env . target_dir ( ) . to_owned ( ) , profile_target_dir : env . profile_target_dir ( ) . to_owned ( ) , profile : env . profile ( ) . to_owned ( ) , libdir : sgx . libdir ( ) . to_owned ( ) , linker : env . linker ( ) . to_owned ( ) , sgx_mode : sgx . sgx_mode ( ) , css : None , dump : None , signed_enclave : None , config_xml : None , unsigned_enclave : None , pubkey : None , privkey : None , gendata : None , signature : None , lds : None , } ) }
Construct a new enclave builder class, using the given paths.
Construct a new enclave builder class using the given paths .
env
&Environment
sgx
&SgxEnvironment
enclave_name
&str
staticlib_dir
&Path
env
&Environment
sgx
&SgxEnvironment
enclave_name
&str
staticlib_dir
&Path