pub async fn save_to(&self, path: impl AsRef<Path>, all: bool) -> io::Result<()> {
        if all {
            if let Some(dir) = path.as_ref().parent() {
                tokio::fs::create_dir_all(dir).await?;
            }
        }

        tokio::fs::write(path.as_ref(), self.session.to_unprotected_string()).await
    }
/// Saves a session to to a file at the specified path
///
/// If all is true, will create all directories leading up to file's location
Saves a session to to a file at the specified path
If all is true, will create all directories leading up to file's location
Saves a session to to a file at the specified path If all is true will create all directories leading up to file ' s location
pub async fn save_to(&self, path: impl AsRef<Path>, all: bool) -> io::Result<()> {
        if all {
            if let Some(dir) = path.as_ref().parent() {
                tokio::fs::create_dir_all(dir).await?;
            }
        }
        tokio::fs::write(path.as_ref(), self.session.to_unprotected_string()).await
    }
pub async fn save_to ( & self , path : impl AsRef < Path > , all : bool ) -> io :: Result < ( ) > { if all { if let Some ( dir ) = path . as_ref ( ) . parent ( ) { tokio :: fs :: create_dir_all ( dir ) . await ? ; } } tokio :: fs :: write ( path . as_ref ( ) , self . session . to_unprotected_string ( ) ) . await }
Saves a session to to a file at the specified path
If all is true, will create all directories leading up to file's location
Saves a session to to a file at the specified path If all is true will create all directories leading up to file ' s location
&self
path
impl AsRef<Path>
all
bool