This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate thrift; | |
extern crate example; | |
use thrift::protocol::{TCompactInputProtocolFactory, TCompactOutputProtocolFactory}; | |
use thrift::transport::{TFramedReadTransportFactory, TFramedWriteTransportFactory}; | |
use thrift::server::TServer; | |
use example::{SimpleServiceSyncHandler, SimpleServiceSyncProcessor}; | |
fn main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate thrift; | |
extern crate example; | |
use thrift::protocol::{TCompactInputProtocol, TCompactOutputProtocol}; | |
use thrift::transport::{TFramedReadTransport, TFramedWriteTransport, TIoChannel, TTcpChannel}; | |
use example::{SimpleServiceSyncClient, TSimpleServiceSyncClient}; | |
fn main() { | |
match run() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate thrift; | |
extern crate ordered_float; | |
extern crate try_from; | |
mod simple_service; | |
pub use simple_service::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "example" | |
version = "0.0.1" | |
publish = false | |
[dependencies] | |
env_logger = "0.4.0" | |
log = "0.3.7" | |
ordered-float = "0.3.0" | |
try_from = "0.2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service SimpleService { | |
string hello(1: string name) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling thrift v1.0.0 (file:///Users/allen/src/rust_projects/thrift/lib/rs) | |
Compiling thrift-test v0.1.0 (file:///Users/allen/src/rust_projects/thrift/test/rs) | |
error[E0277]: the trait bound `thrift::server::TProcessor + std::marker::Send + 'static: std::marker::Sync` is not satisfied | |
--> src/bin/test_server.rs:129:30 | |
| | |
129 | let mut server = TServer::new( | |
| ^^^^^^^^^^^^ the trait `std::marker::Sync` is not implemented for `thrift::server::TProcessor + std::marker::Send + 'static` | |
| | |
= note: `thrift::server::TProcessor + std::marker::Send + 'static` cannot be shared between threads safely | |
= note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<thrift::server::TProcessor + std::marker::Send + 'static>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl<T> TReadTransport for T | |
where | |
T: Read + ?Sized, | |
{ | |
} | |
impl<T> TReadTransport for Box<T> | |
where | |
T: Read + ?Sized, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To learn more, run the command again with --verbose. | |
allen@mrwiggles ~/s/r/t/l/rs> cargo test | |
Compiling thrift v1.0.0 (file:///Users/allen/src/rust_projects/thrift/lib/rs) | |
error[E0308]: mismatched types | |
--> src/protocol/multiplexed.rs:200:16 | |
| | |
200 | mem_fn(&mut chan, |c| assert_eq!(c.write_bytes(), &expected)); | |
| ^^^^^^^^^ expected trait transport::TIOChannel, found struct `transport::mem::TBufferChannel` | |
| | |
= note: expected type `&mut std::boxed::Box<transport::TIOChannel + 'static>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allen@mrwiggles ~/s/r/t/l/rs> cargo build | |
Compiling thrift v1.0.0 (file:///Users/allen/src/rust_projects/thrift/lib/rs) | |
error[E0277]: the trait bound `transport::TTransportFactory + 'static: std::marker::Send` is not satisfied | |
--> src/server/threaded.rs:160:34 | |
| | |
160 | let handle = thread::spawn(move || handle_incoming_connection(&mut self.processor, i_prot, o_prot)); | |
| ^^^^^^^^^^^^^ the trait `std::marker::Send` is not implemented for `transport::TTransportFactory + 'static` | |
| | |
= note: `transport::TTransportFactory + 'static` cannot be sent between threads safely | |
= note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<transport::TTransportFactory + 'static>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allen@mrwiggles ~/s/r/t/l/rs> cargo build | |
Compiling thrift v1.0.0 (file:///Users/allen/src/rust_projects/thrift/lib/rs) | |
error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements | |
--> src/server/threaded.rs:160:29 | |
| | |
160 | let p = &mut self.processor; // FIXME: why can't I inline this? | |
| ^^^^^^^^^^^^^^^^^^^ | |
| | |
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the body at 154:67... | |
--> src/server/threaded.rs:154:68 |
NewerOlder