pub fn select_sinkhole_roles(
list: &SinkholeList,
selector: &SinkholeRoleSelector,
) -> Result<Vec<SinkholeRole>>Expand description
Picks rules of list without changing anything. Each rule is returned once, even if
its pattern is given more than once.
A pattern matches a regex rule only if it is exactly the same text, and a name rule if it is the same name (case and a trailing dot do not matter).
§Errors
Error::InvalidInputiflistwas read without its rules, or a pattern matches more than one rule (e.g. the same text asExactand asRegex); the message lists their uuids.Error::NotFoundif a pattern or the uuid matches no rule. Nothing is returned then, so a typo cannot lead to removing only part of the selection.
§Examples
use dinio_sdk::ops::{self, SinkholeRoleSelector};
let list = client.sinkhole_lists().get(list_id, true).await?;
let selector = SinkholeRoleSelector::Patterns(vec!["Ads.Example.com.".into()]);
for role in ops::select_sinkhole_roles(&list, &selector)? {
client.sinkhole_roles().delete(role.uuid).await?;
}