Interface ErrorCopyFunc

All Superinterfaces:
FunctionPointer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @Generated("org.javagi.JavaGI") public interface ErrorCopyFunc extends FunctionPointer

Functional interface declaration of the ErrorCopyFunc callback.

See Also:
  • Method Details

    • run

      void run(GError srcError, GError destError)

      Specifies the type of function which is called when an extended error instance is copied. It is passed the pointer to the destination error and source error, and should copy only the fields of the private data from srcError to destError.

      Normally, it is better to use G_DEFINE_EXTENDED_ERROR(), as it already takes care of getting the private data from srcError and destError.

      Parameters:
      srcError - source extended error
      destError - destination extended error
      Since:
      2.68
    • upcall

      default void upcall(MemorySegment srcError, MemorySegment destError)
      The upcall method is called from native code. The parameters are marshaled and run(GError, GError) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer