Module: FFI::Libfuse::Adapter

Included in:
Fuse2Compat::Prepend, Fuse3Support::Prepend, Ruby::Prepend
Defined in:
lib/ffi/libfuse/adapter.rb,
lib/ffi/libfuse/adapter/ruby.rb,
lib/ffi/libfuse/adapter/safe.rb,
lib/ffi/libfuse/adapter/debug.rb,
lib/ffi/libfuse/adapter/context.rb,
lib/ffi/libfuse/adapter/pathname.rb,
lib/ffi/libfuse/adapter/interrupt.rb,
lib/ffi/libfuse/adapter/fuse2_compat.rb,
lib/ffi/libfuse/adapter/fuse3_support.rb

Overview

This namespace contains helper Modules that alter the signature or behaviour of the native FuseOperations callbacks

There are two types of Adapters

1) Wrap many fuse methods in a proc that manipulates the arguments in a consistent way

These will implement FuseCallbacks#fuse_wrappers to add the proc which can then...

  • populate thread local information - eg. (Context)
  • wrap common arguments - eg. (Pathname)
  • handle return values/exceptions - eg. (Safe)
  • or just wrap the underlying block - eg. (Debug)

2) Override specific callback methods to change their signatures

These will prepend an internal module that implements the callback methods, manipulating the argument list and passing on to super and then manipulating the result.

The prepend module must include Adapter so that the module methods themselves do not register as callbacks unless there is an implementation by the including class.

eg. Ruby, Fuse2Compat, Fuse3Support

Defined Under Namespace

Modules: Context, Debug, Fuse2Compat, Fuse3Support, Interrupt, Pathname, Ruby, Safe

Instance Method Summary collapse

Instance Method Details

#fuse_super_respond_to?(fuse_method) ⇒ Boolean

Does something other than an adapter (ie the underlying filesystem itself) implement fuse_method.

Can be called by custom implementations of fuse_respond_to? to confirm that the implementing module is not a type 2 Adapter (which itself will call super)

Returns:

  • (Boolean)


33
34
35
36
37
38
39
40
# File 'lib/ffi/libfuse/adapter.rb', line 33

def fuse_super_respond_to?(fuse_method)
  return false unless respond_to?(fuse_method)

  m = method(fuse_method)
  m = m.super_method while m && Adapter.include?(m.owner)

  m && true
end