File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,20 @@ use crate::bindings::ext_php_rs_zend_string_init;
1818/// [`pack`]: https://www.php.net/manual/en/function.pack.php
1919/// [`unpack`]: https://www.php.net/manual/en/function.unpack.php
2020pub unsafe trait Pack : Sized {
21- fn pack_into ( vec : Vec < Self > ) -> * mut ZendString ; //{
22- // unsafe { ext_php_rs_zend_string_init(ptr as *mut i8, vec.len() as _, false) }
23- // }
21+ /// Packs a given vector into a Zend binary string. Can be passed to PHP and then unpacked
22+ /// using the [`unpack`] function. Note you should probably use the [`set_binary`] method on the
23+ /// [`Zval`] struct instead of this function directly, as there is currently no way to set a
24+ /// [`ZendString`] on a [`Zval`] directly.
25+ ///
26+ /// # Parameters
27+ ///
28+ /// * `vec` - The vector to pack into a binary string.
29+ ///
30+ /// [`unpack`]: https://www.php.net/manual/en/function.unpack.php
31+ /// [`Zval`]: crate::php::types::zval::Zval
32+ /// [`ZendString`]: crate::php::types::string::ZendString
33+ /// [`set_binary`]: crate::php::types::zval::Zval#method.set_binary
34+ fn pack_into ( vec : Vec < Self > ) -> * mut ZendString ;
2435
2536 /// Unpacks a given Zend binary string into a Rust vector. Can be used to pass data from `pack`
2637 /// in PHP to Rust without encoding into another format. Note that the data *must* be all one
You can’t perform that action at this time.
0 commit comments