pub struct RadioModel {
pub name: String,
pub serial_max_len: usize,
pub extra_max_len: usize,
pub default_programming_language: String,
/* private fields */
}Expand description
RadioModel class used to calculate the radio code for specified car radio/navigation
Fields§
§name: String@var string A single radio model with its parameters
serial_max_len: usize@var int Required, valid length of the radio serial/seed number
extra_max_len: usize@var int Length of the optional param for radio code generation
default_programming_language: String@var string Default programming language used to determine the format of regular expression formats
Implementations§
Source§impl RadioModel
impl RadioModel
Sourcepub fn regex_string_to_rule(regex_string: &str) -> Result<Regex, Error>
pub fn regex_string_to_rule(regex_string: &str) -> Result<Regex, Error>
In JS you cannot pass the extra parameters for the RegExp in a single string This function splits the provided rule into Reg Exp rule & extra params (like case insensitive flag)
@return RegExp regular expression
Sourcepub fn serial_regex_pattern(&self) -> String
pub fn serial_regex_pattern(&self) -> String
Return the regex pattern for the current programming language only
@return RegExp|string PCRE compatible regular expression or an empty string “”
Sourcepub fn extra_regex_pattern(&self) -> Option<String>
pub fn extra_regex_pattern(&self) -> Option<String>
Extra field (if defined) regex pattern for the current programming language only or null
@return RegExp|null PCRE compatible regular expression or null if not required
Sourcepub fn new(
name: impl Into<String>,
serial_max_len: usize,
serial_regex_pattern: Value,
extra_max_len: usize,
extra_regex_pattern: Option<Value>,
) -> Self
pub fn new( name: impl Into<String>, serial_max_len: usize, serial_regex_pattern: Value, extra_max_len: usize, extra_regex_pattern: Option<Value>, ) -> Self
Initialize RadioModel class with the radio model name, serial & extra fields max. length and regex pattern
@param string name Radio model name @param int serial_max_len Max. serial length @param string|array serial_regex_pattern Serial number single regex pattern or a dictionary @param int extra_max_len Max. extra field length @param string|array|null extra_regex_pattern: Extra field single regex pattern or a dictionary
Trait Implementations§
Source§impl AsRadioModelName for &RadioModel
impl AsRadioModelName for &RadioModel
fn radio_model_name(&self) -> &str
Source§impl AsRadioModelName for RadioModel
impl AsRadioModelName for RadioModel
fn radio_model_name(&self) -> &str
Source§impl Clone for RadioModel
impl Clone for RadioModel
Source§fn clone(&self) -> RadioModel
fn clone(&self) -> RadioModel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more