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")}")
}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:478