pub struct TelemetryConfig {
pub enabled: bool,
pub installation_id: String,
pub created_at: i64,
pub preference_changed_at: Option<i64>,
pub version: u32,
pub remote_endpoint: Option<String>,
pub remote_api_key: Option<String>,
pub remote_enabled: bool,
}Expand description
Telemetry configuration stored on disk
Fields§
§enabled: boolWhether telemetry is enabled (opt-in by default)
installation_id: StringAnonymous identifier for this installation
created_at: i64When the config was first created
preference_changed_at: Option<i64>When the user last changed their preference
version: u32Version of the config format
remote_endpoint: Option<String>Remote telemetry endpoint URL (optional)
remote_api_key: Option<String>API key for remote endpoint (optional)
remote_enabled: boolWhether to send telemetry to remote endpoint
Implementations§
Source§impl TelemetryConfig
impl TelemetryConfig
Sourcepub fn config_path() -> Result<PathBuf>
pub fn config_path() -> Result<PathBuf>
Get the path to the telemetry config file
Sourcepub fn reset_id(&mut self) -> Result<()>
pub fn reset_id(&mut self) -> Result<()>
Reset installation ID (generates new anonymous identifier)
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if telemetry is enabled
Sourcepub fn set_remote_endpoint(&mut self, endpoint: Option<String>) -> Result<()>
pub fn set_remote_endpoint(&mut self, endpoint: Option<String>) -> Result<()>
Configure remote endpoint
Sourcepub fn set_remote_api_key(&mut self, api_key: Option<String>) -> Result<()>
pub fn set_remote_api_key(&mut self, api_key: Option<String>) -> Result<()>
Configure remote API key
Sourcepub fn set_remote_enabled(&mut self, enabled: bool) -> Result<()>
pub fn set_remote_enabled(&mut self, enabled: bool) -> Result<()>
Enable/disable remote sending
Sourcepub fn is_remote_enabled(&self) -> bool
pub fn is_remote_enabled(&self) -> bool
Check if remote telemetry is configured and enabled
Trait Implementations§
Source§impl Clone for TelemetryConfig
impl Clone for TelemetryConfig
Source§fn clone(&self) -> TelemetryConfig
fn clone(&self) -> TelemetryConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TelemetryConfig
impl Debug for TelemetryConfig
Source§impl Default for TelemetryConfig
impl Default for TelemetryConfig
Source§impl<'de> Deserialize<'de> for TelemetryConfig
impl<'de> Deserialize<'de> for TelemetryConfig
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 TelemetryConfig
impl RefUnwindSafe for TelemetryConfig
impl Send for TelemetryConfig
impl Sync for TelemetryConfig
impl Unpin for TelemetryConfig
impl UnwindSafe for TelemetryConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more