Enum mattro::Value[][src]

pub enum Value {
    Literal(Lit),
    Array(Vec<Lit>),
}
Expand description

Represents a value for a name-value attribute.

Variants

Literal(Lit)

A literal value: #[attribute(name="value")].

Array(Vec<Lit>)

An array of literal values: #[attribute(name=1,2,3,4)].

Implementations

Returns true if this value is a literal.

Returns true if this value is an array.

Returns true if this value is a string or byte string literal value.

Returns true if this value is a char literal value.

Returns true if this value is a bool literal value.

Returns true if this value is an integer or byte literal value.

Returns true if this value is a float literal value.

Returns true if this value is a numeric literal (integer or float).

Returns the String representation of this value or None if is not a string literal.

Returns the char representation of this value or None if is not a char literal.

Returns the bool representation of this value or None if is not a bool literal.

Returns the byte representation of this value or None if is not a byte literal.

Converts this value into a integer or None if is not an integer literal.

Converts this value into a float or None if is not a float literal.

Returns a reference to this value literal.

Returns a reference to this value array of literals.

Parses this value into the given type.

Returns None

  • None if the value is not a literal.
  • None if the parse fails.

Parses this value into a Vec<T>

Returns None

  • None if the value is not an array literal.
  • None if the parse fails.

Writes a String representation of this value using the given Write.

Arguments

  • formatter : The formatter used to write the data.
  • use_array_brackets : Wraps the arrays using brackets: [1,2,3].

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

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.