Socket
Book a DemoInstallSign in
Socket

ability

Package Overview
Dependencies
Maintainers
0
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ability

0.1.0
Source
Cargo
Version published
Maintainers
0
Created
Source

Ability

Ability (short for ABI compatibility) provides macros for defining traits with compatible ABI's across compiler versions.

In the short term this allows for defining interfaces for application extensions distributed as shared libraries. Longer term, supporting more complex data types (and maybe generics?) should be supported.

Contributions are welcome

Usage

[dependencies]
ability = { git = "https://github.com/m-hilgendorf/ability.git"}

To add to a trait in your library, just add the #[interface] attribute to your trait definition.

use ability::interface;

#[interface]
pub trait MyTrait {
    fn foo(&self);
}

To implement interfaces for a binary

Limitations

For the moment, the passing of POD/C types is supported (pointers, integers, float, structs marked #[repr(C)], etc).

If you need to pass more complicated data, serialize it and pass as a pointer + length.

Roadmap

  • Documentation/examples
  • Error messaging/failures for invalid traits
  • Clear description of limitations
  • Support for generics ?
  • Support for serializable types ?
  • C header code generation
  • Simpler, safer API for binaries that load the traits

FAQs

Package last updated on 11 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.