__rhandle = $rhandle; $this->__epoch = $epoch; } public function __destruct() { \ShirabeRustObjectRegistry::release($this->__rhandle); } public function __shirabeRustHandleDescriptor(): array { return [ '__rhandle' => $this->__rhandle, '__class' => static::class, '__epoch' => $this->__epoch, ]; } public function __clone() { // PHP has already shallow-copied this stub, so both copies would point at one // entity and release it twice. The Rust side clones the entity instead, applying // whatever __clone semantics the real class defines, and this copy rebinds to the // fresh handle. Entities without clone semantics answer with an explicit error. [$this->__rhandle, $this->__epoch] = \ShirabeRpcRuntime::callRust($this->__rhandle, '__shirabeClone', []); \ShirabeRustObjectRegistry::adopt($this->__rhandle, $this); } public function __construct(IOInterface $io, Config $config, HttpDownloader $httpDownloader, ?EventDispatcher $eventDispatcher = null, ?ProcessExecutor $process = null) { [$this->__rhandle, $this->__epoch] = \ShirabeRpcRuntime::callRust(0, '__shirabeConstruct', [static::class, [$io, $config, $httpDownloader, $eventDispatcher, $process]]); \ShirabeRustObjectRegistry::adopt($this->__rhandle, $this); } public function findPackage(string $name, $constraint): ?PackageInterface { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'findPackage', [$name, $constraint]); } public function findPackages(string $name, $constraint): array { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'findPackages', [$name, $constraint]); } public function addRepository(RepositoryInterface $repository): void { \ShirabeRpcRuntime::callRust($this->__rhandle, 'addRepository', [$repository]); } public function prependRepository(RepositoryInterface $repository): void { \ShirabeRpcRuntime::callRust($this->__rhandle, 'prependRepository', [$repository]); } public function createRepository(string $type, array $config, ?string $name = null): RepositoryInterface { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'createRepository', [$type, $config, $name]); } public function setRepositoryClass(string $type, $class): void { \ShirabeRpcRuntime::callRust($this->__rhandle, 'setRepositoryClass', [$type, $class]); } public function getRepositories(): array { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getRepositories', []); } public function setLocalRepository(InstalledRepositoryInterface $repository): void { \ShirabeRpcRuntime::callRust($this->__rhandle, 'setLocalRepository', [$repository]); } public function getLocalRepository(): InstalledRepositoryInterface { return \ShirabeRpcRuntime::callRust($this->__rhandle, 'getLocalRepository', []); } }