Skip to main content

LeafValue

Enum LeafValue 

Source
pub enum LeafValue<'a> {
Show 16 variants Bool(bool), Duration(Duration), F64(f64), F64Map(&'a HashMap<String, f64>), I64(i64), JsonList(&'a [Value]), JsonMap(&'a Map<String, Value>), JsonMapList(&'a [Map<String, Value>]), OptionI64(Option<i64>), OptionStr(Option<&'a str>), Str(&'a str), StringList(&'a [String]), StringListMap(&'a HashMap<String, Vec<String>>), StringMap(&'a HashMap<String, String>), StringMapList(&'a [HashMap<String, String>]), Uncompared,
}
Expand description

A supported configuration leaf’s typed value, borrowed from a DatadogConfiguration.

One variant per Rust leaf type the generator knows, plus Uncompared for any other type. Pair this with LEAVES to read any supported dotted key’s typed value without cloning it.

Variants§

§

Bool(bool)

A bool leaf.

§

Duration(Duration)

A std::time::Duration leaf.

§

F64(f64)

A f64 leaf.

§

F64Map(&'a HashMap<String, f64>)

A &'a HashMap<String, f64> leaf.

§

I64(i64)

A i64 leaf.

§

JsonList(&'a [Value])

A &'a [::serde_json::Value] leaf.

§

JsonMap(&'a Map<String, Value>)

A &'a ::serde_json::Map<String, ::serde_json::Value> leaf.

§

JsonMapList(&'a [Map<String, Value>])

A &'a [::serde_json::Map<String, ::serde_json::Value>] leaf.

§

OptionI64(Option<i64>)

A Option<i64> leaf.

§

OptionStr(Option<&'a str>)

A Option<&'a str> leaf.

§

Str(&'a str)

A &'a str leaf.

§

StringList(&'a [String])

A &'a [String] leaf.

§

StringListMap(&'a HashMap<String, Vec<String>>)

A &'a HashMap<String, Vec<String>> leaf.

§

StringMap(&'a HashMap<String, String>)

A &'a HashMap<String, String> leaf.

§

StringMapList(&'a [HashMap<String, String>])

A &'a [HashMap<String, String>] leaf.

§

Uncompared

A leaf whose Rust type no other variant covers. Its value is not read.

Trait Implementations§

Source§

impl<'a> Clone for LeafValue<'a>

Source§

fn clone(&self) -> LeafValue<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for LeafValue<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Copy for LeafValue<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for LeafValue<'a>

§

impl<'a> RefUnwindSafe for LeafValue<'a>

§

impl<'a> Send for LeafValue<'a>

§

impl<'a> Sync for LeafValue<'a>

§

impl<'a> Unpin for LeafValue<'a>

§

impl<'a> UnsafeUnpin for LeafValue<'a>

§

impl<'a> UnwindSafe for LeafValue<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more