pub struct ParseOptions {
    pub default_float_size: FloatSize,
    pub default_int_size: IntSize,
    pub max_array_size: Option<usize>,
}
Expand description

Options specific to how edres should parse markup.

Fields

default_float_size: FloatSize

The floating point type to infer from input.

This can be either f32 or f64. Values that are too large to fit the chosen default will instead be inferred as a larger type.

default_int_size: IntSize

The integer type to infer from input.

This can be anything from i8 to i128, including isize. Values that are too large to fit the chosen default will instead be inferred as a larger type.

max_array_size: Option<usize>

What size of sequence, if any, to consider small enough to use an array instead of a Vec.

For example, if Some(4) is provided, then sequences of more than 4 items in the input will generate a Vec in the resulting struct. Meanwhile, a sequence of 4 values would instead generate a [T; 4].

Implementations

Examples
assert_eq!(ParseOptions::new(), ParseOptions {
    default_float_size: FloatSize::F64,
    default_int_size: IntSize::I64,
    max_array_size: 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
Examples
assert_eq!(ParseOptions::default(), ParseOptions::new());
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
Compare self to key and return true if they are equal.

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
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.