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")}")
}Output
true
pub(api) fn hasRole(role: str) -> boolComplexity. O(roles).
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
role | str |
Returns
bool
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/node.oxl:152