pub struct FieldSpec {Show 14 fields
pub name: Option<String>,
pub field_type: FieldType,
pub width: Option<usize>,
pub precision: Option<usize>,
pub alignment: Option<char>,
pub sign: Option<char>,
pub fill: Option<char>,
pub zero_pad: bool,
pub strftime_format: Option<String>,
pub original_type_char: Option<char>,
pub nested_subpattern: Option<String>,
pub nested_regex_body: Option<String>,
pub regex_lookbehind: Option<String>,
pub regex_lookahead: Option<String>,
}Fields§
§name: Option<String>§field_type: FieldType§width: Option<usize>§precision: Option<usize>§alignment: Option<char>§sign: Option<char>§fill: Option<char>§zero_pad: bool§strftime_format: Option<String>§original_type_char: Option<char>§nested_subpattern: Option<String>When field_type is Nested: inner pattern text (e.g. "{inner:d}").
nested_regex_body: Option<String>Unanchored regex body for the inner pattern (filled after recursive compile; issue #12).
regex_lookbehind: Option<String>Concatenated (?<=…) / (?<!…) tokens after the type, before the field body (issue #9).
regex_lookahead: Option<String>Concatenated (?=…) / (?!…) tokens after the type, after the field body (issue #9).
Implementations§
Source§impl FieldSpec
impl FieldSpec
Sourcepub fn to_regex_pattern(
&self,
custom_patterns: &HashMap<String, String>,
next_field_is_greedy: Option<bool>,
allow_empty_delimited: bool,
) -> String
pub fn to_regex_pattern( &self, custom_patterns: &HashMap<String, String>, next_field_is_greedy: Option<bool>, allow_empty_delimited: bool, ) -> String
allow_empty_delimited: for default unconstrained string fields only (no width,
precision, alignment), use .*? instead of .+? so an empty capture is allowed when
the field is delimited by pattern literals (formatparse#83 / parse#136 remainder).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FieldSpec
impl RefUnwindSafe for FieldSpec
impl Send for FieldSpec
impl Sync for FieldSpec
impl Unpin for FieldSpec
impl UnsafeUnpin for FieldSpec
impl UnwindSafe for FieldSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more