Class PolywrapClient

    • Constructor Detail

      • PolywrapClient

        PolywrapClient(<Error class: unknown class> ffiClient)
    • Method Detail

      • getFfiInvoker

         final <Error class: unknown class> getFfiInvoker()
      • invokeWrapperRaw

         Result<ByteArray> )>invokeWrapperRaw(Wrapper wrapper, Uri uri, String method, ByteArray args, ByteArray env, <Error class: unknown class> resolutionContext)

        Invoke a wrapper using an instance of the wrapper.

        Parameters:
        wrapper - An instance of a Wrapper to invoke.
        uri - The URI of the wrapper to be invoked.
        method - The method to be called on the wrapper.
        args - Arguments for the method, encoded in the MessagePack byte format
        env - Env variables for the wrapper invocation, encoded in the MessagePack byte format
        resolutionContext - The FfiUriResolutionContext to be used during URI resolution, or null for a default context.
      • loadWrapper

         Result<Wrapper> )>loadWrapper(Uri uri, <Error class: unknown class> resolutionContext)

        Resolves the Wrapper at the specified URI.

        Parameters:
        uri - The URI of the wrapper to resolve.
        resolutionContext - The FfiUriResolutionContext to be used during URI resolution, or null for a default context.
      • tryResolveUri

         Result<<Error class: unknown class>> )>tryResolveUri(Uri uri, <Error class: unknown class> resolutionContext)

        Try to resolve a URI to a URI, package or wrapper.

        Parameters:
        uri - The URI to resolve.
        resolutionContext - The FfiUriResolutionContext to be used during URI resolution, or null for a default context.
      • invokeRaw

         List<UByte> ,java.lang.String,java.util.List,java.util.List,.)>invokeRaw(<Error class: unknown class> uri, String method, List<UByte> args, List<UByte> env, <Error class: unknown class> resolutionContext)

        Invokes the wrapper at the specified URI with the provided options.

        Parameters:
        uri - The URI of the wrapper to be invoked.
        method - The method to be called on the wrapper.
        args - Arguments for the method, encoded in the MessagePack byte format
        env - Env variables for the wrapper invocation, encoded in the MessagePack byte format
        resolutionContext - The FfiUriResolutionContext to be used during URI resolution, or null for a default context.
      • invokeRaw

         Result<ByteArray> )>invokeRaw(Uri uri, String method, ByteArray args, ByteArray env, <Error class: unknown class> resolutionContext)

        Invoke a wrapper. This method automatically retrieves and caches the wrapper.

        Parameters:
        uri - The URI of the wrapper to be invoked.
        method - The method to be called on the wrapper.
        args - Arguments for the method, encoded in the MessagePack byte format
        env - Env variables for the wrapper invocation, encoded in the MessagePack byte format
        resolutionContext - The FfiUriResolutionContext to be used during URI resolution, or null for a default context.
      • invoke

         final <T extends Any, R extends Any> Result<)>R> )>invoke(Uri uri, String method, )>T args, Map<String, Object> env, <Error class: unknown class> resolutionContext)

        Invokes the wrapper at the specified URI with the provided method and arguments of type )>T, and environment.

        Parameters:
        uri - The URI of the wrapper to be invoked.
        method - The method to be called on the wrapper.
        args - An instance of serializable type )>T representing the arguments to be passed to the method.
        env - A map representing the environment to be used during the invocation.
        resolutionContext - The FfiUriResolutionContext to be used during URI resolution, or null for a default context.
      • invoke

         final <T extends Any, E extends Any, R extends Any> Result<)>R> )>invoke(Uri uri, String method, )>T args, )>E env, <Error class: unknown class> resolutionContext)

        Invokes the wrapper at the specified URI with the provided method and arguments of type )>T, and environment.

        Parameters:
        uri - The URI of the wrapper to be invoked.
        method - The method to be called on the wrapper.
        args - An instance of serializable type )>T representing the arguments to be passed to the method.
        env - An instance of serializable type )>E representing the environment to be used during the invocation.
        resolutionContext - The FfiUriResolutionContext to be used during URI resolution, or null for a default context.
      • invoke

         final <R extends Any> Result<)>R> )>invoke(Uri uri, String method, Map<String, Object> args, Map<String, Object> env, <Error class: unknown class> resolutionContext)

        Invokes the wrapper at the specified URI with the provided method, arguments, and environment.

        Parameters:
        uri - The URI of the wrapper to be invoked.
        method - The method to be called on the wrapper.
        args - A map of arguments to be passed to the method.
        env - A map representing the environment to be used during the invocation.
        resolutionContext - The FfiUriResolutionContext to be used during URI resolution, or null for a default context.
      • getImplementations

         Result<List<Uri>> getImplementations(Uri uri)

        Retrieves the list of implementation URIs for the specified interface URI.

        Parameters:
        uri - The URI of the interface for which implementations are being requested.
      • getEnvByUri

         Result<Map<String, Object>> getEnvByUri(Uri uri)

        Returns an env (a set of environmental variables) from the configuration used to instantiate the client.

        Parameters:
        uri - the URI used to register the env