pub struct Separators {
pub field: char,
pub component: char,
pub repeat: char,
pub escape: char,
pub subcomponent: char,
}
Expand description
The separators for the message
Fields§
§field: char
The character that separates fields (default: '|'
)
component: char
The character that separates components (default: '^'
)
repeat: char
The character that indicates repeats (default: '~'
)
escape: char
The escape character (default: '\'
)
subcomponent: char
The character that separates sub-components (default: '&'
)
Implementations§
Source§impl Separators
impl Separators
Sourcepub fn decode<S: AsRef<str>>(&self, source: S) -> String
pub fn decode<S: AsRef<str>>(&self, source: S) -> String
Given an un-decoded source, will decode the string into its canonical form
§Examples
let separators = Separators::default();
assert_eq!(
separators.decode(r#"Pierre DuRho\S\ne \T\ Cie"#).as_str(),
r#"Pierre DuRho^ne & Cie"#
);
Sourcepub fn is_special_char(&self, c: char) -> bool
pub fn is_special_char(&self, c: char) -> bool
Utility to check if a character is a special character
Trait Implementations§
Source§impl Clone for Separators
impl Clone for Separators
Source§fn clone(&self) -> Separators
fn clone(&self) -> Separators
Returns a copy 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 Separators
impl Debug for Separators
Source§impl Default for Separators
impl Default for Separators
Source§impl<'de> Deserialize<'de> for Separators
impl<'de> Deserialize<'de> for Separators
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Separators
impl PartialEq for Separators
Source§impl Serialize for Separators
impl Serialize for Separators
impl Copy for Separators
impl Eq for Separators
impl StructuralPartialEq for Separators
Auto Trait Implementations§
impl Freeze for Separators
impl RefUnwindSafe for Separators
impl Send for Separators
impl Sync for Separators
impl Unpin for Separators
impl UnwindSafe for Separators
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.