Coder Social home page Coder Social logo

Comments (5)

ftelnov avatar ftelnov commented on July 20, 2024

@rmanoka Please, take a look at #16 for an implementation and review

from async-scoped.

rmanoka avatar rmanoka commented on July 20, 2024

Nice work @ftelnov .

I think I'd made the trait private, to ensure we're not violating any rust memory invariants. In particular, I wasn't sure if there's a safe-rust executor, whose guarantees may not match the requirements of this crate, and hence implementing the traits on this executor leads to memory-UB even via safe-rust.

As an escape hatch, I'm okay with making the trait unsafe, and explaining that the user has to prove/verify the necessary things before exposing it via safe-rust.

from async-scoped.

ftelnov avatar ftelnov commented on July 20, 2024

At the first glance at feature gates I realized you actually did it on purpose. Thanks for the explanation!
I think we simply can mark the traits unsafe, because it solves the problem and delegates responsibility of necessary checks to the end-user. I also think it's okay from the perspective of unsafe-code pervasivity - in the end, those traits are not being implemented often.

I've added unsafe markers and write yet simple top-level comment about traits unsafety.

But what should be additionally done is invariants definition. What contracts must implementer of these unsafe traits uphold? In other words, what are requirements for the executor? Do we have an example of the dangerous executor?

from async-scoped.

rmanoka avatar rmanoka commented on July 20, 2024

Thanks @ftelnov ; have merged this. I'll release it in the next couple weeks.

from async-scoped.

rmanoka avatar rmanoka commented on July 20, 2024

Released as 0.8.0

from async-scoped.

Related Issues (18)

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.