method secret.of
Wraps value; secret<str> keeps a private copy that is wiped on drop.
Example:
fn main() io {
let token = secret.of("abc")
print("{token}")
}Output
***
pub(api) static fn of(value: T) -> secret<T>Complexity. O(1) (O(n) for `secret<str>`, which copies the text).
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
value | T |
Returns
secret<T>
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/types.oxl:681