#plugin #generic #lua #input-output

adapter

Adapter provides a generic interface for plugins to interact with a host application

5 unstable releases

0.3.1 Jul 24, 2024
0.3.0 Jul 24, 2024
0.2.0 Jul 18, 2024
0.1.1 Jul 17, 2024
0.1.0 Jul 17, 2024

#301 in WebAssembly

Download history 1/week @ 2024-10-09 1/week @ 2024-10-16 2/week @ 2024-10-30 3/week @ 2024-11-06 2/week @ 2024-11-13 6/week @ 2024-11-20 1/week @ 2024-12-04 2/week @ 2024-12-11

153 downloads per month
Used in 3 crates

MIT license

32KB

Adapter

[!WARNING]
This library is in no way production ready.

Adapter is a library meant for providing a standard interface for which one can communicate with a variety of interfaces or plugins. It was created from a desire to be able to configure programs with a variety of different languages.

To see the thought process behind this, see RAMBLINGS.md.

The key concept of this library is the Adapter trait. It hinges on the idea that communicating with a foreign interface should be as simple as a function that has an input and an output. We use an identifier to determine the "endpoint" that we want to access.

pub trait Adapter<'a, Input, Output, Identifier> {
    type Error;

    fn call(&'a mut self, identifier: Identifier, input: Input) -> Result<Output, Self::Error>;
}

An adapter is generic over the input, output, identifier and error that is uses. It takes in an identifier and an input, and returns a result with the output or an error. By being generic, we can require stricter traits be applied to our inputs and outputs.

No runtime deps

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy