OxL Reference

method ClusterApi.hasRole

Whether this node has the role role (§12.6 cluster.self.hasRole; all matches every role).

Example:

oxl✓ checked in CI
fn main() io {
  print("{cluster.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:478

See also