Skip to content

Crablicious/actf-rs

Repository files navigation

actf-rs

This crate contains (mostly) safe rust bindings for actf. Consuming events from an event generator can be done safely, but instantiating and connecting generators may not be. Likewise, writing a new event generator in rust would be completely unsafe.

In terms of performance, there should not be a big hit. The API that is used for event processing has been kept fully allocation free (in line with actf). Values are either primitives (cheap copies) or references to the raw data from actf. Strings that originate from the metadata are represented as the str type, so that will cause an additional utf8 validity check when basing it off a C string.

actf-rs opts to panic whenever the C API contract is broken or if it conflicts with the CTF specification. This allows actf-rs to provide enums without C-isms such as count sentinels, and less errors that really should never happen.

actf-sys is used as a submodule since it is not published on crates.io yet, so make sure to initialize and update it as follows once you have cloned actf-rs:

$ git submodule update --init

TODO

  • API documentation.
  • strings in fields only have a convenient API for utf8 encoded strings. actf-rs could include widestring-rs for more convenient utf16 and utf32 support.
  • actf_printer is yet to be ported. the thinking is that printing and/or serialization can be done natively in rust.
  • more usage of it to invoke confidence.

Usage

See count.rs and philo.rs for simple example usages.

License

Due to the possibility of statically linking actf through actf-sys, the license "LGPLv3.0 or later" is chosen, see COPYING and COPYING.LESSER.

About

Safe-ich rust bindings for the C library actf

Topics

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Contributors

Languages