pub(crate) fn take_optional<F, X, S>(mut subject: Pin<&mut S>, fun: F)
    where
        F: for<'r> FnOnce(&'r mut S) -> &'r mut Option<X>,
        X: Unpin,
{
    // Safety: we never move `self.value` (the Optional)
    let field = unsafe { subject.as_mut().map_unchecked_mut(fun) };
    // Remove future out of optional
    let _ = field.get_mut().take();
}
/// Takes an optional field member of the portal and sets the optional to None.
///
/// Safety: Because the optional fields are never moved, this is considered safe, albeit the pinning.
Takes an optional field member of the portal and sets the optional to None.
Safety: Because the optional fields are never moved, this is considered safe, albeit the pinning.
Takes an optional field member of the portal and sets the optional to None . Safety : Because the optional fields are never moved this is considered safe albeit the pinning .
pub(crate) fn take_optional<F, X, S>(mut subject: Pin<&mut S>, fun: F)
    where
        F: for<'r> FnOnce(&'r mut S) -> &'r mut Option<X>,
        X: Unpin,
{
    // Safety: we never move `self.value` (the Optional)
    let field = unsafe { subject.as_mut().map_unchecked_mut(fun) };
    // Remove future out of optional
    let _ = field.get_mut().take();
}
pub ( crate ) fn take_optional < F , X , S > ( mut subject : Pin < & mut S > , fun : F ) where F : for < ' r > FnOnce ( & ' r mut S ) -> & ' r mut Option < X > , X : Unpin , { // Safety: we never move `self.value` (the Optional) let field = unsafe { subject . as_mut ( ) . map_unchecked_mut ( fun ) } ; // Remove future out of optional let _ = field . get_mut ( ) . take ( ) ; }
Takes an optional field member of the portal and sets the optional to None.
Takes an optional field member of the portal and sets the optional to None .
subject
Pin<&mut S>
fun
F
subject
Pin<&mut S>
fun
F