method Principal.isUser
The caller is a user; with id it must be that user (none -> false).
Example:
fn main() io {
let ann = Principal.User("ann", [], Map.new(), false, none)
print("{ann.isUser(none)} {ann.isUser("ann")} {ann.isUser("bob")} {Principal.Anonymous.isUser(none)}")
}Output
false true false false
pub(api) fn isUser(id: str?) -> boolComplexity. O(1).
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
id | str? |
Returns
bool
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/rpc.oxl:76