pub unsafe trait FnOnceWithSig<Sig: FnSig>: Sized + SealedWithSig<Sig> { }Expand description
Trait implemented by closures that can be invoked once with signature Sig.
§Safety
VTABLE_ONCE.call_oncemust be a valid trampoline forSelfthat, given a pointer to a properly aligned and initializedSelfwith exclusive ownership, movesSelfout of the pointer and invokes it once.VTABLE_ONCE.dropmust be a valid drop function forSelfthat, given a pointer to a properly aligned and initializedSelfwith exclusive access, dropsSelfin place (or is a no-op if!core::mem::needs_drop::<Self>()).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".