logo
pub enum KdlValue {
    RawString(String),
    String(String),
    Base2(i64),
    Base8(i64),
    Base10(i64),
    Base10Float(f64),
    Base16(i64),
    Bool(bool),
    Null,
}
Expand description

A specific KDL Value.

Variants

RawString(String)

String(String)

Base2(i64)

A KDL Number in binary form (e.g. 0b010101).

Base8(i64)

A KDL Number in octal form (e.g. 0o12345670).

Base10(i64)

A KDL Number in decimal form (e.g. 1234567890).

Base10Float(f64)

A KDL Number in decimal form (e.g. 1234567890.123), interpreted as a Rust f64.

Base16(i64)

A KDL Number in hexadecimal form (e.g. 1234567890abcdef).

Bool(bool)

Null

Implementations

Returns true if the value is a KdlValue::RawString.

Returns true if the value is a KdlValue::String.

Returns true if the value is a KdlValue::String or KdlValue::RawString.

Returns true if the value is a KdlValue::Base2.

Returns true if the value is a KdlValue::Base8.

Returns true if the value is a KdlValue::Base10.

Returns true if the value is a KdlValue::Base16.

Returns true if the value is a KdlValue::Base2, KdlValue::Base8, KdlValue::Base10, or KdlValue::Base16.

Returns true if the value is a KdlValue::Base10Float.

Returns true if the value is a KdlValue::Base10Float.

Returns true if the value is a KdlValue::Bool.

Returns true if the value is a KdlValue::Null.

Returns Some(&str) if the KdlValue is a KdlValue::RawString or a KdlValue::String, otherwise returns None.

Returns Some(i64) if the KdlValue is a KdlValue::Base2, KdlValue::Base8, KdlValue::Base10, or KdlValue::Base16, otherwise returns None.

Returns Some(f64) if the KdlValue is a KdlValue::Base10Float, otherwise returns None.

Returns Some(bool) if the KdlValue is a KdlValue::Bool, otherwise returns None.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.