Interface MountOperation.ShowUnmountProgressCallback

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

@FunctionalInterface public static interface MountOperation.ShowUnmountProgressCallback extends FunctionPointer

Functional interface declaration of the ShowUnmountProgressCallback callback.

See Also:
  • Method Details

    • run

      void run(String message, long timeLeft, long bytesLeft)

      Emitted when an unmount operation has been busy for more than some time (typically 1.5 seconds).

      When unmounting or ejecting a volume, the kernel might need to flush pending data in its buffers to the volume stable storage, and this operation can take a considerable amount of time. This signal may be emitted several times as long as the unmount operation is outstanding, and then one last time when the operation is completed, with bytesLeft set to zero.

      Implementations of GMountOperation should handle this signal by showing an UI notification, and then dismiss it, or show another notification of completion, when bytesLeft reaches zero.

      If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the primary text in a GtkMessageDialog.

      Since:
      2.34
    • upcall

      default void upcall(MemorySegment sourceMountOperation, MemorySegment message, long timeLeft, long bytesLeft)
      The upcall method is called from native code. The parameters are marshaled and run(String, long, long) is executed.
    • toCallback

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