call_object_accessor: Call an Object Accessor by Candidate Function Names

View source: R/semantic_adapter.R

call_object_accessorR Documentation

Call an Object Accessor by Candidate Function Names

Description

Try accessor functions in order and return the first successful result. Useful for extension authors who need compatibility across optional dependency APIs.

Usage

call_object_accessor(
  obj,
  fun_names,
  default = NULL,
  package = NULL,
  args = list()
)

Arguments

obj

Object passed as the first argument to the accessor.

fun_names

Character vector of accessor function names to try.

default

Value returned when no accessor can be called successfully.

package

Optional package name to resolve accessors from first.

args

Optional named list of additional arguments passed to accessor.

Value

The accessor result or default.


aisdk documentation built on May 29, 2026, 9:07 a.m.