Skip to content

signals.fuse: method not found #96

@WhyNotHugo

Description

@WhyNotHugo

I'm using some code very very similar to the example one from the docs:

async fn handle_signals(signals: Signals) {
    let mut signals = signals.fuse();
    while let Some(signal) = signals.next().await {
        match signal {
            SIGALRM => {
                println!("Got an alarm! 🎉")
            }
            _ => unreachable!(),
        }
    }
}

However, it seems the method signal.fuse does not exist:

error[E0599]: no method named `fuse` found for struct `signal_hook_tokio::SignalsInfo` in the current scope
  --> src/main.rs:24:31
   |
24 |     let mut signals = signals.fuse();
   |                               ^^^^ method not found in `signal_hook_tokio::SignalsInfo`
   |
  ::: /home/hugo/.cache/cargo/registry/src/github.com-1ecc6299db9ec823/signal-hook-tokio-0.3.0/src/lib.rs:92:1
   |
92 | pub struct SignalsInfo<E: Exfiltrator = SignalOnly>(OwningSignalIterator<UnixStream, E>);
   | ----------------------------------------------------------------------------------------- doesn't satisfy `signal_hook_tokio::SignalsInfo: Iterator`
   |
   = note: the method `fuse` exists but the following trait bounds were not satisfied:
           `signal_hook_tokio::SignalsInfo: Iterator`
           which is required by `&mut signal_hook_tokio::SignalsInfo: Iterator`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.

Is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions