pub struct EnterpriseConfig {
pub gateway_url: Option<String>,
pub instance_token: Option<String>,
pub instance_id: Option<String>,
pub always_inject_headers: bool,
pub disabled: bool,
}Expand description
Enterprise Suite connection configuration ([enterprise] in config.toml).
Example:
[enterprise]
gateway_url = "https://api.leanctx.com"
instance_token = "lctx_inst_..."
instance_id = "runtime-macbook-yves"Fields§
§gateway_url: Option<String>Base URL of the LeanCTX Enterprise Suite Gateway.
When set, all provider requests are routed through this gateway AND
x-leanctx-* metadata headers are injected.
Env override: LEAN_CTX_ENTERPRISE_GATEWAY_URL.
instance_token: Option<String>Bearer token for authenticating this Runtime instance with the Suite.
Env override: LEAN_CTX_ENTERPRISE_TOKEN.
instance_id: Option<String>Stable identifier for this Runtime instance (e.g. “macbook-yves”,
“ci-runner-3”). Sent as x-leanctx-instance. Auto-generated from
hostname if unset.
always_inject_headers: boolWhether to inject x-leanctx-* headers even when NOT routing through
the gateway (i.e. when using direct provider upstreams but still wanting
to report metadata to a sidecar collector). Default: headers are only
injected when gateway_url is set.
disabled: boolDisable the enterprise integration without removing the config block.
Implementations§
Source§impl EnterpriseConfig
impl EnterpriseConfig
Sourcepub fn effective_gateway_url(&self) -> Option<&str>
pub fn effective_gateway_url(&self) -> Option<&str>
Resolve effective gateway URL (config → env).
Sourcepub fn effective_gateway_url_owned(&self) -> Option<String>
pub fn effective_gateway_url_owned(&self) -> Option<String>
Resolve effective gateway URL with env override (owned).
Sourcepub fn effective_token(&self) -> Option<String>
pub fn effective_token(&self) -> Option<String>
Resolve the instance token (config → env).
Sourcepub fn effective_instance_id(&self) -> String
pub fn effective_instance_id(&self) -> String
Resolve instance ID (config → hostname fallback).
Sourcepub fn should_inject_headers(&self) -> bool
pub fn should_inject_headers(&self) -> bool
Whether header injection is active for the current request.
Trait Implementations§
Source§impl Clone for EnterpriseConfig
impl Clone for EnterpriseConfig
Source§fn clone(&self) -> EnterpriseConfig
fn clone(&self) -> EnterpriseConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EnterpriseConfig
impl Debug for EnterpriseConfig
Source§impl Default for EnterpriseConfig
impl Default for EnterpriseConfig
Source§fn default() -> EnterpriseConfig
fn default() -> EnterpriseConfig
Source§impl<'de> Deserialize<'de> for EnterpriseConfigwhere
EnterpriseConfig: Default,
impl<'de> Deserialize<'de> for EnterpriseConfigwhere
EnterpriseConfig: Default,
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>,
Source§impl PartialEq for EnterpriseConfig
impl PartialEq for EnterpriseConfig
Source§impl Serialize for EnterpriseConfig
impl Serialize for EnterpriseConfig
impl StructuralPartialEq for EnterpriseConfig
Auto Trait Implementations§
impl Freeze for EnterpriseConfig
impl RefUnwindSafe for EnterpriseConfig
impl Send for EnterpriseConfig
impl Sync for EnterpriseConfig
impl Unpin for EnterpriseConfig
impl UnsafeUnpin for EnterpriseConfig
impl UnwindSafe for EnterpriseConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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