pub trait PhpOnceClosure {
    // Required method
    fn into_closure(self) -> Closure;
}
Available on crate feature closure only.
Expand description

Implemented on FnOnce types which can be used as PHP closures. See Closure.

Internally, this trait should wrap the FnOnce closure inside a FnMut closure, and prevent the user from calling the closure more than once.

Required Methods§

source

fn into_closure(self) -> Closure

Converts the Rust FnOnce closure into a FnMut closure, and then into a PHP closure.

Implementations on Foreign Types§

source§

impl<A, B, C, D, E, F, G, H, Ret> PhpOnceClosure for Box<dyn FnOnce(A, B, C, D, E, F, G, H) -> Ret>
where for<'a> A: FromZval<'a> + 'static, for<'a> B: FromZval<'a> + 'static, for<'a> C: FromZval<'a> + 'static, for<'a> D: FromZval<'a> + 'static, for<'a> E: FromZval<'a> + 'static, for<'a> F: FromZval<'a> + 'static, for<'a> G: FromZval<'a> + 'static, for<'a> H: FromZval<'a> + 'static, Ret: IntoZval + 'static,

source§

impl<A, B, C, D, E, F, G, Ret> PhpOnceClosure for Box<dyn FnOnce(A, B, C, D, E, F, G) -> Ret>
where for<'a> A: FromZval<'a> + 'static, for<'a> B: FromZval<'a> + 'static, for<'a> C: FromZval<'a> + 'static, for<'a> D: FromZval<'a> + 'static, for<'a> E: FromZval<'a> + 'static, for<'a> F: FromZval<'a> + 'static, for<'a> G: FromZval<'a> + 'static, Ret: IntoZval + 'static,

source§

impl<A, B, C, D, E, F, Ret> PhpOnceClosure for Box<dyn FnOnce(A, B, C, D, E, F) -> Ret>
where for<'a> A: FromZval<'a> + 'static, for<'a> B: FromZval<'a> + 'static, for<'a> C: FromZval<'a> + 'static, for<'a> D: FromZval<'a> + 'static, for<'a> E: FromZval<'a> + 'static, for<'a> F: FromZval<'a> + 'static, Ret: IntoZval + 'static,

source§

impl<A, B, C, D, E, Ret> PhpOnceClosure for Box<dyn FnOnce(A, B, C, D, E) -> Ret>
where for<'a> A: FromZval<'a> + 'static, for<'a> B: FromZval<'a> + 'static, for<'a> C: FromZval<'a> + 'static, for<'a> D: FromZval<'a> + 'static, for<'a> E: FromZval<'a> + 'static, Ret: IntoZval + 'static,

source§

impl<A, B, C, D, Ret> PhpOnceClosure for Box<dyn FnOnce(A, B, C, D) -> Ret>
where for<'a> A: FromZval<'a> + 'static, for<'a> B: FromZval<'a> + 'static, for<'a> C: FromZval<'a> + 'static, for<'a> D: FromZval<'a> + 'static, Ret: IntoZval + 'static,

source§

impl<A, B, C, Ret> PhpOnceClosure for Box<dyn FnOnce(A, B, C) -> Ret>
where for<'a> A: FromZval<'a> + 'static, for<'a> B: FromZval<'a> + 'static, for<'a> C: FromZval<'a> + 'static, Ret: IntoZval + 'static,

source§

impl<A, B, Ret> PhpOnceClosure for Box<dyn FnOnce(A, B) -> Ret>
where for<'a> A: FromZval<'a> + 'static, for<'a> B: FromZval<'a> + 'static, Ret: IntoZval + 'static,

source§

impl<A, Ret> PhpOnceClosure for Box<dyn FnOnce(A) -> Ret>
where for<'a> A: FromZval<'a> + 'static, Ret: IntoZval + 'static,

source§

impl<R> PhpOnceClosure for Box<dyn FnOnce() -> R>
where R: IntoZval + 'static,

Implementors§