pub fn new(config: UmociConfiguration) -> Result<Self> {
        let command = config
            .command
            .or_else(|| find_binary("umoci"))
            .context(UmociNotFoundError {})?;

        let timeout = config
            .timeout
            .or_else(|| Some(Duration::from_millis(5000)))
            .unwrap();

        let bundles_directory = config
            .bundles_directory
            .unwrap()
            .canonicalize()
            .context(InvalidPathError {})?;

        debug!("Umoci initialized.");

        Ok(Self {
            command,
            timeout,
            bundles_directory,
            log_level: config.log_level,
            verbose: config.debug,
        })
    }
/// Create an Umoci instance to interact with the binary
Create an Umoci instance to interact with the binary
Create an Umoci instance to interact with the binary
pub fn new(config: UmociConfiguration) -> Result<Self> {
        let command = config
            .command
            .or_else(|| find_binary("umoci"))
            .context(UmociNotFoundError {})?;
        let timeout = config
            .timeout
            .or_else(|| Some(Duration::from_millis(5000)))
            .unwrap();
        let bundles_directory = config
            .bundles_directory
            .unwrap()
            .canonicalize()
            .context(InvalidPathError {})?;
        debug!("Umoci initialized.");
        Ok(Self {
            command,
            timeout,
            bundles_directory,
            log_level: config.log_level,
            verbose: config.debug,
        })
    }
pub fn new ( config : UmociConfiguration ) -> Result < Self > { let command = config . command . or_else ( | | find_binary ( " " ) ) . context ( UmociNotFoundError { } ) ? ; let timeout = config . timeout . or_else ( | | Some ( Duration :: from_millis ( 5000 ) ) ) . unwrap ( ) ; let bundles_directory = config . bundles_directory . unwrap ( ) . canonicalize ( ) . context ( InvalidPathError { } ) ? ; debug ! ( " " ) ; Ok ( Self { command , timeout , bundles_directory , log_level : config . log_level , verbose : config . debug , } ) }
Create an Umoci instance to interact with the binary
Create an Umoci instance to interact with the binary
config
UmociConfiguration
config
UmociConfiguration