pub fn match_sinkhole_list<'a>(
lists: &'a [SinkholeList],
reference: &str,
) -> Result<Option<&'a SinkholeList>>Expand description
The list of lists that reference names: its uuid, or its name (trimmed, case does
not matter). Ok(None) if none matches.
§Errors
Error::InvalidInput if the name matches several lists (names are not unique); the
message lists their uuids.
§Examples
use dinio_sdk::models::SinkholeList;
use dinio_sdk::ops::match_sinkhole_list;
let lists = [list(1, Some("ads")), list(2, Some("Tracking")), list(3, Some("tracking"))];
assert_eq!(match_sinkhole_list(&lists, "ADS").unwrap().unwrap().uuid.as_u128(), 1);
assert!(match_sinkhole_list(&lists, "tracking").is_err());
assert!(match_sinkhole_list(&lists, "other").unwrap().is_none());