pub fn fetch_by_name(string: &str) -> Option<BackendPointer> {
    // Check each map to see if we can find the backend name

    if let Some((_, target)) = TIER_ONE_MAP.iter().find(|(name, _)| name == &string) {
        return Some(BackendPointer::One(*target));
    };
    if let Some((_, target)) = TIER_TWO_MAP.iter().find(|(name, _)| name == &string) {
        return Some(BackendPointer::Two(*target));
    };

    let (_, target) = TIER_THREE_MAP.iter().find(|(name, _)| name == &string)?;
    Some(BackendPointer::Three(*target))
}
// Fetches a backend marker given it's full name
// Returning the enum avoids the need to return a Trait
Fetches a backend marker given it's full name
Returning the enum avoids the need to return a Trait
Fetches a backend marker given it ' s full name Returning the enum avoids the need to return a Trait
pub fn fetch_by_name(string: &str) -> Option<BackendPointer> {
    // Check each map to see if we can find the backend name
    if let Some((_, target)) = TIER_ONE_MAP.iter().find(|(name, _)| name == &string) {
        return Some(BackendPointer::One(*target));
    };
    if let Some((_, target)) = TIER_TWO_MAP.iter().find(|(name, _)| name == &string) {
        return Some(BackendPointer::Two(*target));
    };
    let (_, target) = TIER_THREE_MAP.iter().find(|(name, _)| name == &string)?;
    Some(BackendPointer::Three(*target))
}
pub fn fetch_by_name ( string : & str ) -> Option < BackendPointer > { // Check each map to see if we can find the backend name if let Some ( ( _ , target ) ) = TIER_ONE_MAP . iter ( ) . find ( | ( name , _ ) | name == & string ) { return Some ( BackendPointer :: One ( * target ) ) ; } ; if let Some ( ( _ , target ) ) = TIER_TWO_MAP . iter ( ) . find ( | ( name , _ ) | name == & string ) { return Some ( BackendPointer :: Two ( * target ) ) ; } ; let ( _ , target ) = TIER_THREE_MAP . iter ( ) . find ( | ( name , _ ) | name == & string ) ? ; Some ( BackendPointer :: Three ( * target ) ) }
Fetches a backend marker given it's full name
Returning the enum avoids the need to return a Trait
Fetches a backend marker given it ' s full name Returning the enum avoids the need to return a Trait
string
&str
string
&str