#[derive(Copy, Clone)]
pub enum Format {
BSON,
}
pub struct Output {
fmt: Format,
indexation: bool,
output_name: String,
}
impl Output {
pub fn new(fmt: Format, indexation: bool, output_name: &Option<String>) -> Self {
let output_name = match output_name {
Some(name) => {
let mut bson_name = name.clone();
bson_name.push_str(".bson");
bson_name
}
None => String::from("embedding.bson"),
};
Output {
fmt,
indexation,
output_name,
}
}
pub fn get_fmt(&self) -> Format {
self.fmt
}
pub fn get_output_name(&self) -> &String {
&self.output_name
}
pub fn get_indexation(&self) -> bool {
self.indexation
}
}
impl Default for Output {
fn default() -> Self {
Output {
fmt: Format::BSON,
indexation: true,
output_name: String::from("embedding.bson"),
}
}
}