OxL Reference

method secret.of

Wraps value; secret<str> keeps a private copy that is wiped on drop.

Example:

oxl✓ checked in CI
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

NameType
valueT

Returns

secret<T>

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/types.oxl:681

See also