pub fn new(
        account: String,
        container: String,
        auth_url: String,
        username: String,
        password: String,
        project_name: String,
    ) -> Result<Self, ChiconError> {
        env::set_var("OS_AUTH_URL", auth_url);
        env::set_var("OS_USERNAME", username);
        env::set_var("OS_PASSWORD", password);
        env::set_var("OS_PROJECT_NAME", project_name);

        let mut runtime = Runtime::new().expect("cannot create a tokio runtime");
        let adapter = Adapter::from_env(OBJECT_STORAGE)?;

        runtime.block_on(adapter.put_empty(vec![account.clone(), container.clone()], None))?;

        Ok(SwiftFileSystem { account, container, adapter })
    }
/// Create a swift file system passing the right credentials informations in parameters
Create a swift file system passing the right credentials informations in parameters
Create a swift file system passing the right credentials informations in parameters
pub fn new(
        account: String,
        container: String,
        auth_url: String,
        username: String,
        password: String,
        project_name: String,
    ) -> Result<Self, ChiconError> {
        env::set_var("OS_AUTH_URL", auth_url);
        env::set_var("OS_USERNAME", username);
        env::set_var("OS_PASSWORD", password);
        env::set_var("OS_PROJECT_NAME", project_name);
        let mut runtime = Runtime::new().expect("cannot create a tokio runtime");
        let adapter = Adapter::from_env(OBJECT_STORAGE)?;
        runtime.block_on(adapter.put_empty(vec![account.clone(), container.clone()], None))?;
        Ok(SwiftFileSystem { account, container, adapter })
    }
pub fn new ( account : String , container : String , auth_url : String , username : String , password : String , project_name : String , ) -> Result < Self , ChiconError > { env :: set_var ( " " , auth_url ) ; env :: set_var ( " " , username ) ; env :: set_var ( " " , password ) ; env :: set_var ( " " , project_name ) ; let mut runtime = Runtime :: new ( ) . expect ( " " ) ; let adapter = Adapter :: from_env ( OBJECT_STORAGE ) ? ; runtime . block_on ( adapter . put_empty ( vec ! [ account clone ( ) container clone ( ) ] , None ) ) ? ; Ok ( SwiftFileSystem { account , container , adapter } ) }
Create a swift file system passing the right credentials informations in parameters
Create a swift file system passing the right credentials informations in parameters
account
String
container
String
auth_url
String
username
String
password
String
project_name
String