pub enum DelimiterStrategy {
FirstEquals,
PreferSpaced,
}Expand description
Strategy for choosing which = sign is the key-value delimiter
When a line contains multiple = characters, the delimiter strategy
determines which one splits the key from the value.
Variants§
FirstEquals
Always split on the first = character.
This matches the OCaml reference implementation.
Keys cannot contain = with this strategy.
Example: a=b=c → key a, value b=c
PreferSpaced
Prefer = (space-equals-space) as the delimiter when present.
Falls back to the first = if no spaced delimiter exists.
This allows keys to contain = when the actual delimiter is
surrounded by spaces.
Examples:
https://x.com?q=1 = result→ keyhttps://x.com?q=1, valueresultkey=value→ keykey, valuevalue(fallback, no=)key = value→ keykey, valuevalue
Trait Implementations§
Source§impl Clone for DelimiterStrategy
impl Clone for DelimiterStrategy
Source§fn clone(&self) -> DelimiterStrategy
fn clone(&self) -> DelimiterStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DelimiterStrategy
impl Debug for DelimiterStrategy
Source§impl Default for DelimiterStrategy
impl Default for DelimiterStrategy
Source§fn default() -> DelimiterStrategy
fn default() -> DelimiterStrategy
Returns the “default value” for a type. Read more
Source§impl PartialEq for DelimiterStrategy
impl PartialEq for DelimiterStrategy
impl Copy for DelimiterStrategy
impl Eq for DelimiterStrategy
impl StructuralPartialEq for DelimiterStrategy
Auto Trait Implementations§
impl Freeze for DelimiterStrategy
impl RefUnwindSafe for DelimiterStrategy
impl Send for DelimiterStrategy
impl Sync for DelimiterStrategy
impl Unpin for DelimiterStrategy
impl UnsafeUnpin for DelimiterStrategy
impl UnwindSafe for DelimiterStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.