pub fn new(topic: &str, database_directory: Option<PathBuf>) -> Self {
        let connection_string = database_directory
            .map(|pathbuf| pathbuf.display().to_string())
            .unwrap_or_else(|| {
                TempDir::new()
                    .expect("Creating a temporary directory should work")
                    .into_path()
                    .display()
                    .to_string()
            });

        info!("Write buffer: File-based in `{}`", connection_string);

        Self {
            type_: "file".to_string(),
            connection_string,
            topic: topic.to_string(),
            connection_config: Default::default(),
            auto_create_topics: Some(NonZeroU32::new(1).unwrap()),
        }
    }
/// Create a new instance for all-in-one mode, only allowing some arguments.
/// If `database_directory` is not specified, creates a new temporary directory.
Create a new instance for all-in-one mode, only allowing some arguments.
If `database_directory` is not specified, creates a new temporary directory.
Create a new instance for all - in - one mode only allowing some arguments . If ` database_directory ` is not specified creates a new temporary directory .
pub fn new(topic: &str, database_directory: Option<PathBuf>) -> Self {
        let connection_string = database_directory
            .map(|pathbuf| pathbuf.display().to_string())
            .unwrap_or_else(|| {
                TempDir::new()
                    .expect("Creating a temporary directory should work")
                    .into_path()
                    .display()
                    .to_string()
            });
        info!("Write buffer: File-based in `{}`", connection_string);
        Self {
            type_: "file".to_string(),
            connection_string,
            topic: topic.to_string(),
            connection_config: Default::default(),
            auto_create_topics: Some(NonZeroU32::new(1).unwrap()),
        }
    }
pub fn new ( topic : & str , database_directory : Option < PathBuf > ) -> Self { let connection_string = database_directory . map ( | pathbuf | pathbuf . display ( ) . to_string ( ) ) . unwrap_or_else ( | | { TempDir :: new ( ) . expect ( " " ) . into_path ( ) . display ( ) . to_string ( ) } ) ; info ! ( " " connection_string ) ; Self { type_ : " " . to_string ( ) , connection_string , topic : topic . to_string ( ) , connection_config : Default :: default ( ) , auto_create_topics : Some ( NonZeroU32 :: new ( 1 ) . unwrap ( ) ) , } }
Create a new instance for all-in-one mode, only allowing some arguments.
Create a new instance for all - in - one mode only allowing some arguments .
topic
&str
database_directory
Option<PathBuf>
topic
&str
database_directory
Option<PathBuf>