Plugin

Trait Plugin 

Source
pub trait Plugin {
Show 17 methods // Required methods fn id() -> &'static [u8; 4]; fn name() -> &'static str; fn description() -> &'static str; fn url() -> &'static str; fn register_functions() -> Vec<Registration>; // Provided methods fn enable_configure_button() -> bool { ... } fn enable_init_and_shutdown() -> bool { ... } fn enable_idle() -> bool { ... } fn enable_file_and_session_shutdown() -> bool { ... } fn session_shutdown(_session_id: fmx_ptrtype) { ... } fn file_shutdown(_session_id: fmx_ptrtype, _file_id: fmx_ptrtype) { ... } fn preferences() { ... } fn idle(_session_id: fmx_ptrtype) { ... } fn not_idle(_session_id: fmx_ptrtype) { ... } fn script_paused(_session_id: fmx_ptrtype) { ... } fn script_running(_session_id: fmx_ptrtype) { ... } fn un_safe(_session_id: fmx_ptrtype) { ... }
}
Expand description

Implement this trait for your plugin struct. The different functions are used to give FileMaker information about the plugin. You also need to register all your functions/script steps in the trait implementation.

§Example

struct MyPlugin;

impl Plugin for MyPlugin {
    fn id() -> &'static [u8; 4] { &b"MyPl" }
    fn name() -> &'static str { "MY PLUGIN" }
    fn description() -> &'static str { "Does all sorts of great things." }
    fn url() -> &'static str { "http://myplugin.com" }

    fn register_functions() -> Vec<Registration> {
        vec![Registration::Function {
            id: 100,
            name: "MyPlugin_MyFunction",
            definition: "MyPlugin_MyFunction( arg1 ; arg2 )",
            description: "Does some really great stuff.",
            min_args: 2,
            max_args: 2,
            display_in_dialogs: true,
            compatibility_flags: Compatibility::Future as u32,
            min_ext_version: ExternVersion::V160,
            min_fm_version: "18.0.2",
            allowed_versions: AllowedVersions {developer: true, pro: true, web: true, sase: true, runtime: true},
            function_ptr: Some(MyFunction::extern_func),
            }
        ]
    }
}

Required Methods§

Source

fn id() -> &'static [u8; 4]

Unique 4 letter identifier for the plug-in.

Source

fn name() -> &'static str

Plug-in’s name.

Source

fn description() -> &'static str

Description of the plug-in.

Source

fn url() -> &'static str

Url to send users to from the help in FileMaker. The function’s name that the user will be appended to the url when clicked.

Source

fn register_functions() -> Vec<Registration>

Register all custom functions/script steps

Provided Methods§

Source

fn enable_configure_button() -> bool

Defaults to false

Source

fn enable_init_and_shutdown() -> bool

Defaults to true

Source

fn enable_idle() -> bool

Defaults to false

Source

fn enable_file_and_session_shutdown() -> bool

Defaults to false

Source

fn session_shutdown(_session_id: fmx_ptrtype)

Source

fn file_shutdown(_session_id: fmx_ptrtype, _file_id: fmx_ptrtype)

Source

fn preferences()

Source

fn idle(_session_id: fmx_ptrtype)

Source

fn not_idle(_session_id: fmx_ptrtype)

Source

fn script_paused(_session_id: fmx_ptrtype)

Source

fn script_running(_session_id: fmx_ptrtype)

Source

fn un_safe(_session_id: fmx_ptrtype)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§