[−][src]Trait core_extensions::maybe_unsafe::MaybeUnsafe
The trait used to choose whether traits' function/method is safe(using IsSafe) or unsafe(using IsUnsafe) to call.
When passing a MaybeUnsafe as a parameter it is recommended to use an
impl AsRef<IsSafe>
/impl AsRef<IsUnsafe>
parameter for convenience.
This trait has a Sealed super trait to prevent users of this library from implementing it.
For examples of how to use this look at the module-level documentation.
Required methods
unsafe fn with<F, U>(f: F) -> U where
F: FnOnce(&Self) -> U,
F: FnOnce(&Self) -> U,
Constructs a MaybeUnsafe,and passes it by reference to prevent it from escaping this function call.
This is unsafe because it applies to both IsSafe and IsUnsafe.