pub struct PhyTraceConfig {
pub source: SourceConfig,
pub transport: TransportConfig,
pub license: LicenseConfig,
pub buffer: BufferConfig,
pub retry: RetryConfig,
pub provenance: ProvenanceConfig,
pub emitter: EmitterConfig,
pub logging: LoggingConfig,
}Expand description
Main SDK configuration.
Fields§
§source: SourceConfigSource configuration.
transport: TransportConfigTransport configuration.
license: LicenseConfigLicense configuration.
buffer: BufferConfigBuffer configuration.
retry: RetryConfigRetry configuration.
provenance: ProvenanceConfigProvenance configuration.
emitter: EmitterConfigEmitter configuration.
logging: LoggingConfigLogging configuration.
Implementations§
Source§impl PhyTraceConfig
impl PhyTraceConfig
Sourcepub fn new(source_id: impl Into<String>) -> Self
pub fn new(source_id: impl Into<String>) -> Self
Create a minimal configuration with required fields.
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> PhyTraceResult<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> PhyTraceResult<Self>
Load configuration from a YAML file.
Sourcepub fn from_yaml(yaml: &str) -> PhyTraceResult<Self>
pub fn from_yaml(yaml: &str) -> PhyTraceResult<Self>
Parse configuration from YAML string.
Sourcepub fn to_yaml(&self) -> PhyTraceResult<String>
pub fn to_yaml(&self) -> PhyTraceResult<String>
Serialize configuration to YAML string.
Sourcepub fn with_env_overrides(self) -> Self
pub fn with_env_overrides(self) -> Self
Apply environment variable overrides.
Supported environment variables:
- PHYTRACE_SOURCE_ID
- PHYTRACE_ENDPOINT
- PHYTRACE_API_KEY
- PHYTRACE_BUFFER_PATH
Sourcepub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
Set the transport endpoint.
Sourcepub fn with_api_key(self, api_key: impl Into<String>) -> Self
pub fn with_api_key(self, api_key: impl Into<String>) -> Self
Set the API key.
Sourcepub fn with_source_type(self, source_type: SourceType) -> Self
pub fn with_source_type(self, source_type: SourceType) -> Self
Set the source type.
Sourcepub fn with_signing(
self,
key_id: impl Into<String>,
secret_key: impl Into<String>,
) -> Self
pub fn with_signing( self, key_id: impl Into<String>, secret_key: impl Into<String>, ) -> Self
Enable provenance signing with a secret key.
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validate the configuration.
Sourcepub fn connect_timeout(&self) -> Duration
pub fn connect_timeout(&self) -> Duration
Get connect timeout as Duration.
Sourcepub fn request_timeout(&self) -> Duration
pub fn request_timeout(&self) -> Duration
Get request timeout as Duration.
Sourcepub fn emit_interval(&self) -> Duration
pub fn emit_interval(&self) -> Duration
Get emit interval as Duration.
Trait Implementations§
Source§impl Clone for PhyTraceConfig
impl Clone for PhyTraceConfig
Source§fn clone(&self) -> PhyTraceConfig
fn clone(&self) -> PhyTraceConfig
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 PhyTraceConfig
impl Debug for PhyTraceConfig
Source§impl<'de> Deserialize<'de> for PhyTraceConfig
impl<'de> Deserialize<'de> for PhyTraceConfig
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 PhyTraceConfig
impl RefUnwindSafe for PhyTraceConfig
impl Send for PhyTraceConfig
impl Sync for PhyTraceConfig
impl Unpin for PhyTraceConfig
impl UnwindSafe for PhyTraceConfig
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