OxL Справочник OxL
РусскийEnglish

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:

oxl✓ проверяется в CI
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

Параметры

ИмяТип
rolestr

Возвращает

bool

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/node.oxl:152

См. также