Giter VIP home page Giter VIP logo

ecap-rs's Introduction

ecap-rs

This is a compatible rewrite of libecap in Rust.

This project has the following goals:

  • Permit adapters written in Rust to be easily used by C++ hosts, such as Squid.
  • Permit hosts written in Rust to use C++ adapters.

The toplevel crates are as follows:

  • ecap: core crate, defines traits and structs (similar to libecap itself)
  • ecap-common: shared library which provides service/translator registration
  • ecap-common-link: workaround for Cargo, shim over ecap-common so that crates don't need build scripts
  • ecap-cpp: translator from C++ to Rust types (currently incomplete)
  • ecap-sys: C API for the C++ libecap library.
  • adapter-minimal: minimal adapter written in Rust

ecap-rs's People

Contributors

mark-simulacrum avatar

Stargazers

sujiacong avatar Rust avatar

Watchers

James Cloos avatar  avatar sujiacong avatar  avatar

ecap-rs's Issues

Exception/Panic handling

In both directions panics and exceptions carry the same semantic meaning so they should be caught at boundaries and repropagated within each language.

Send/Sync bounds, mutability

We want to require only Send for adapter::{Service, Transaction}. Additionally, host::Transaction will gain a new method that returns an abstract Token that can be passed to the host to resume the transaction.

Must change host methods to take reference to adapter transaction

This is needed to prevent code like the following, since use_adapted may potentially call other &mut methods on self; as such we need to "give it" that access and permit the compiler to catch us if we're doing something non-beneficial.

fn start(&mut self, host: &mut H::TransactionRef) {
    let a = &self.field;
    let adapted = ...;
    host.use_adapted(adapted);
}

Handle predefined libecap::Names

The current theorized approach is to have the host manage the ID allocation. ecap would provide a set of helper functions which internally call into the host and return the allocated Name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.