-
-
Notifications
You must be signed in to change notification settings - Fork 79
Closed
Description
The docs state:
#[implements(ce)]- Implements the given interface on the class. Can be used multiple times. ce must be a valid Rust expression when it is called inside the#[php_module]function.
How do I use this to implement an interface provided by the standard library of PHP? For example, I want to implement ArrayAccess on my own class.
My current approach is this:
#[php_class]
#[implements(ext_php_rs::zend::class::ClassEntry::try_find("ArrayAccess").unwrap())]
pub struct Test {
}But the class type seems to be private:
error[E0603]: module `class` is private
--> src/lib.rs:205:1
If I get this to work, how do I actually implement the methods? Does having the appropriate method names suffice (putting renaming of methods aside)?
If this has a solution, I'd love to contribute this to the docs. I really like this library!
Metadata
Metadata
Assignees
Labels
No labels