method ClusterMember.hasRole
Whether the member has the role role (a member with the role all, or with no roles at all - the implicit role all of a node without a cluster - matches every role).
Example:
fn main() io {
let me = cluster.selfInfo()
print("{me.hasRole("store")}")
}Вывод
true
pub(api) fn hasRole(role: str) -> boolСложность. O(roles).
С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
role | str |
Возвращает
bool
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/node.oxl:152