You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've copy-pasted the example given (even though it is not complete) and got this compile-time error:
error[E0271]: type mismatch resolving `<jsonrpc_pubsub::IoDelegate<sub::RpcImpl, Arc<Session>> as IntoIterator>::Item == (std::string::String, RemoteProcedure<()>)`
--> src/rpc.rs:95:8
|
95 | io.extend_with(sub::RpcImpl::default().to_delegate());
| ^^^^^^^^^^^ expected struct `Arc`, found `()`
|
= note: expected tuple `(std::string::String, RemoteProcedure<Arc<Session>>)`
found tuple `(std::string::String, RemoteProcedure<()>)`
I'm using current git master because I don't want to mess with futures 0.1.
Any ideas what is wrong here? Also having a full example in there would help to make sure it doesn't regress.
UPD: Seems to be caused by IoHandler::new(); instead of PubSubHandler::new(MetaIoHandler::default()), but now a new error:
error[E0277]: the trait bound `Session: Default` is not satisfied
--> src/rpc.rs:82:37
|
82 | let server = ServerBuilder::new(io)
| ^^ the trait `Default` is not implemented for `Session`
|
::: /home/nazar-pc/.cargo/git/checkouts/jsonrpc-22a65938f7d26b63/92e3c14/ws/src/server_builder.rs:37:12
|
37 | T: Into<core::MetaIoHandler<M, S>>,
| ------------------------------- required by this bound in `ServerBuilder::<M, S>::new`
|
= note: required because of the requirements on the impl of `Default` for `Arc<Session>`
UPD 2: pubsub/examples/pubsub.rs is also broken, starting with context.sender.clone() that needs to be context.sender() to there is no such thing as an acquire/release load for obvious reasons; did it ever work at all?
The text was updated successfully, but these errors were encountered:
@nazar-pc Could you clarify which example do you mean?
The first error indeed like using IoHandler in pub-sub examples (Metadata defaults to ())
To overcome the second error you need to use ServerBuilder::with_meta_extractor.
The reason for this is that pubsub requires the Session object to be created by the transport layer (so that we can push updates to the client) - there is no Default there.
I've copy-pasted the example given (even though it is not complete) and got this compile-time error:
I'm using current git master because I don't want to mess with futures 0.1.
Any ideas what is wrong here? Also having a full example in there would help to make sure it doesn't regress.
UPD: Seems to be caused by
IoHandler::new();
instead ofPubSubHandler::new(MetaIoHandler::default())
, but now a new error:UPD 2:
pubsub/examples/pubsub.rs
is also broken, starting withcontext.sender.clone()
that needs to becontext.sender()
tothere is no such thing as an acquire/release load
for obvious reasons; did it ever work at all?The text was updated successfully, but these errors were encountered: