Skip to content

Stabilization #192

@notgull

Description

@notgull

I'd like to stabilize calloop's public API to reduce breaking changes. This way when we release v1.0, we shouldn't have to release v2.0. Since we have no more public dependencies as of v0.14.0 this is now feasible.

Potential semver hazards, just from glancing over docs.rs:

  • It should be explicitly stated somewhere that calloop is not compatible with the web. We also don't support WASI at the moment.
  • calloop::Readiness, calloop::Mode, calloop::PostAction and calloop::Interest could be non_exhaustive. User code doesn't need to match on these.
  • calloop::Readiness's error field could be removed, since it's not emitted by polling.
  • calloop::futures::ExecutorDestroyed should be made non-instantiable by users.
  • We can probably deprecate/remove calloop::generic::FdWrapper, since it can be replaced by BorrowedFd::borrow_raw.
  • Make the pub fields of Generic not exposed, or only exposed via methods.
  • Make calloop::io::{Readable, Writable} return Result<()> instead of ().
  • Make calloop::ping::{Ping, PingSource} a newtype wrapper instead of a type alias.
  • Make calloop::signal::Singals's method take impl IntoIterator<Item = impl Borrow<Signal>> instead of &[Signal] to increase compatibility.
  • Do we want to keep calloop::timer::Timer::current_deadline?
  • For EventSource::Error, what do we gain from it being Sync? Especially since the rest of calloop is usually thread-unsafe.
  • Do we want to expose RefCell::ref in Dispatcher? It might be better to use closures here.
  • EventLoop::try_new should be renamed to EventLoop::new. (Rename EventLoop::try_new to new #217)

Other possible improvements:

  • Enable all features on docs.rs
  • Web compatibility? Probably not feasible.
  • Add a way to get a LoopHandle reference without cloning the loop Rc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions