Struct re_analytics::native::config::Config
source · pub struct Config {
pub analytics_enabled: bool,
pub analytics_id: String,
pub session_id: Uuid,
pub opt_in_metadata: HashMap<String, Property>,
pub config_file_path: PathBuf,
pub data_dir_path: PathBuf,
is_first_run: bool,
}
Fields§
§analytics_enabled: bool
§analytics_id: String
§session_id: Uuid
A unique ID for this session.
opt_in_metadata: HashMap<String, Property>
Opt-in meta-data you can set via rerun analytics
.
For instance Rerun employees are encouraged to set rerun analytics email
.
For real users, this is always empty.
config_file_path: PathBuf
The path of the config file.
data_dir_path: PathBuf
The directory where pending data is stored.
is_first_run: bool
Is this the first time the user runs the app?
This is determined based on whether the analytics config already exists on disk.
Implementations§
source§impl Config
impl Config
pub fn new() -> Result<Self, ConfigError>
pub fn load_or_default() -> Result<Self, ConfigError>
pub fn load() -> Result<Option<Self>, ConfigError>
pub fn save(&self) -> Result<(), ConfigError>
pub fn config_dir(&self) -> &Path
pub fn config_file(&self) -> &Path
pub fn data_dir(&self) -> &Path
pub fn is_first_run(&self) -> bool
fn project_dirs() -> Result<ProjectDirs, ConfigError>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more