-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
It is not clear to me from the documentation how any of the async functions should be used. The documentation for AsyncDisplay says "It can do everything that a Display can do, but it doesn’t block and return values. Instead, it returns a Future". Apparently AsyncDisplay is implemented for BasicDisplay. The functions appear to live in AsyncDisplayFunctionsExt (which is in the prelude), but confusingly they are not in scope for an instance of BasicDisplay. Here is my test code which is the best I've been able to figure out so far.
use breadx::display::{DisplayBase, DisplayConnection, AsyncDisplay, CanBeAsyncDisplay};
use breadx::prelude::*;
pub(crate) async fn foo(conn: &mut DisplayConnection) {
AsyncDisplayFunctionsExt::intern_atom_immediate(conn, false, b"foo").await.unwrap();
}This generates the error:
error[E0277]: the trait bound `BasicDisplay<BufConnection<NameConnection>>: AsyncDisplay` is not satisfied
--> src/test.rs:5:53
|
5 | AsyncDisplayFunctionsExt::intern_atom_immediate(conn, false, b"foo").await.unwrap();
| ----------------------------------------------- ^^^^ the trait `AsyncDisplay` is not implemented for `BasicDisplay<BufConnection<NameConnection>>`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `AsyncDisplay`:
&CellDisplay<Dpy>
&mut D
Box<D>
CellDisplay<Dpy>
Can you please provide examples or documentation for how to use these functions?
Metadata
Metadata
Assignees
Labels
No labels