OxL Reference

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✓ checked in CI
fn main() io {
  let me = cluster.selfInfo()
  print("{me.hasRole("store")}")
}
Output
true
pub(api) fn hasRole(role: str) -> bool

Complexity. O(roles).

Since. 1.0.0-beta

Parameters

NameType
rolestr

Returns

bool

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/node.oxl:152

See also