pub fn random_cob_id_with_format(msg_format: &MsgFormat) -> u32 {
    if !msg_format.cob_id_values.is_empty() {
        return msg_format
            .cob_id_values
            .choose(&mut rand::thread_rng())
            .unwrap()
            .to_owned();
    }

    let mut rng = rand::thread_rng();
    rng.gen_range(msg_format.cob_id_range.start..msg_format.cob_id_range.end)
}
/// Generate a random cob_id within message format allowed range or from provided COB-ID list
/// cob_id_values takes precedence over cob_id_range
Generate a random cob_id within message format allowed range or from provided COB-ID list
cob_id_values takes precedence over cob_id_range
Generate a random cob_id within message format allowed range or from provided COB - ID list cob_id_values takes precedence over cob_id_range
pub fn random_cob_id_with_format(msg_format: &MsgFormat) -> u32 {
    if !msg_format.cob_id_values.is_empty() {
        return msg_format
            .cob_id_values
            .choose(&mut rand::thread_rng())
            .unwrap()
            .to_owned();
    }
    let mut rng = rand::thread_rng();
    rng.gen_range(msg_format.cob_id_range.start..msg_format.cob_id_range.end)
}
pub fn random_cob_id_with_format ( msg_format : & MsgFormat ) -> u32 { if ! msg_format . cob_id_values . is_empty ( ) { return msg_format . cob_id_values . choose ( & mut rand :: thread_rng ( ) ) . unwrap ( ) . to_owned ( ) ; } let mut rng = rand :: thread_rng ( ) ; rng . gen_range ( msg_format . cob_id_range . start .. msg_format . cob_id_range . end ) }
Generate a random cob_id within message format allowed range or from provided COB-ID list
cob_id_values takes precedence over cob_id_range
Generate a random cob_id within message format allowed range or from provided COB - ID list cob_id_values takes precedence over cob_id_range
msg_format
&MsgFormat
msg_format
&MsgFormat