pub struct ConsentInputs {
pub env_override: Option<String>,
pub do_not_track: bool,
pub config: ConfigPreference,
pub has_key: bool,
pub in_ci: bool,
}Expand description
Inputs to the consent decision, gathered from the environment.
Fields§
§env_override: Option<String>MESH_LLM_ANALYTICS, if set.
do_not_track: boolWhether DO_NOT_TRACK is set to a truthy value.
config: ConfigPreferenceWhat the config file says.
has_key: boolWhether a project key is available.
in_ci: boolWhether this looks like CI.
Implementations§
Source§impl ConsentInputs
impl ConsentInputs
Sourcepub fn from_env(config: ConfigPreference) -> Self
pub fn from_env(config: ConfigPreference) -> Self
Read every input from the process environment.
Sourcepub fn resolve(&self) -> Disposition
pub fn resolve(&self) -> Disposition
Resolve the inputs into a single disposition.
An explicit MESH_LLM_ANALYTICS wins over everything else, including
the CI check, so a deliberate test run can still exercise the path.
Trait Implementations§
Source§impl Clone for ConsentInputs
impl Clone for ConsentInputs
Source§impl Debug for ConsentInputs
impl Debug for ConsentInputs
Source§impl Default for ConsentInputs
impl Default for ConsentInputs
impl Eq for ConsentInputs
Source§impl PartialEq for ConsentInputs
impl PartialEq for ConsentInputs
impl StructuralPartialEq for ConsentInputs
Auto Trait Implementations§
impl Freeze for ConsentInputs
impl RefUnwindSafe for ConsentInputs
impl Send for ConsentInputs
impl Sync for ConsentInputs
impl Unpin for ConsentInputs
impl UnsafeUnpin for ConsentInputs
impl UnwindSafe for ConsentInputs
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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