///|
pub(all) enum ParseMode {
Auto
HRI
Raw
} derive(Debug, Eq)
///|
pub struct ParseOptions {
mode : ParseMode
max_length : Int
allow_group_separator : Bool
allow_empty_variable : Bool
} derive(Debug, Eq)
///|
pub fn ParseOptions::strict(
max_length? : Int = 4096,
allow_group_separator? : Bool = true,
) -> ParseOptions {
{ mode: HRI, max_length, allow_group_separator, allow_empty_variable: false }
}
///|
pub fn ParseOptions::auto(
max_length? : Int = 4096,
allow_group_separator? : Bool = true,
) -> ParseOptions {
{ mode: Auto, max_length, allow_group_separator, allow_empty_variable: false }
}
///|
pub fn ParseOptions::raw(
max_length? : Int = 4096,
allow_group_separator? : Bool = true,
) -> ParseOptions {
{ mode: Raw, max_length, allow_group_separator, allow_empty_variable: false }
}
///|
pub fn ParseOptions::with_empty_variable(self : ParseOptions) -> ParseOptions {
{ ..self, allow_empty_variable: true }
}
///|
pub fn ParseOptions::with_max_length(
self : ParseOptions,
max_length : Int,
) -> ParseOptions {
{ ..self, max_length, }
}
///|
pub fn ParseOptions::mode(self : ParseOptions) -> ParseMode {
self.mode
}
///|
pub fn ParseOptions::max_length(self : ParseOptions) -> Int {
self.max_length
}
///|
pub fn ParseOptions::group_separator_allowed(self : ParseOptions) -> Bool {
self.allow_group_separator
}