method ClusterApi.hasRole
Whether this node has the role role (§12.6 cluster.self.hasRole; all matches every role).
Example:
fn main() io {
print("{cluster.hasRole("store")}")
}Вывод
true
pub(api) fn hasRole(role: str) -> boolСложность. O(roles).
С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
role | str |
Возвращает
bool
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/node.oxl:478