ice_rs/lib.rs
1
2//! ## Quick Start ##
3//! This quick start guide will cover a client for the [ZeroC Ice Minimal Sample](https://github.com/zeroc-ice/ice-demos/tree/3.7/python/Ice/minimal). Create a binary application with `cargo new minimal-client` and add `ice-rs` to your `[build-dependencies]`and `[dependencies]`. Now add a `build.rs` file with the following content:
4//!
5//! ```Rust
6//! use ice_rs::slice::parser;
7//! use std::path::Path;
8//!
9//! fn main() -> Result<(), Box<dyn std::error::Error>> {
10//! println!("cargo:rerun-if-changed=build.rs");
11//! let ice_files = vec![
12//! String::from("<path/to/Hello.ice>")
13//! ];
14//! let root_module = parser::parse_ice_files(&input, ".")?;
15//! root_module.generate(Path::new("./src/gen"))
16//! }
17//! ```
18//!
19//! Now add the following to you `main.rs`:
20//! ```Rust
21//! use ice_rs::communicator::Communicator;
22//!
23//! mod gen;
24//! use crate::gen::demo::{Hello,HelloPrx};
25//!
26//! #[tokio::main]
27//! async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
28//! let mut comm = Communicator::new().await?;
29//! let proxy = comm.string_to_proxy("hello:default -h localhost -p 10000").await?;
30//! let mut hello_prx = HelloPrx::checked_cast(proxy).await?;
31//!
32//! hello_prx.say_hello(None).await
33//! }
34//! ```
35
36#[macro_use]
37extern crate pest_derive;
38
39#[macro_use]
40extern crate ice_derive;
41
42pub mod errors;
43pub mod protocol;
44pub mod encoding;
45pub mod tcp;
46pub mod ssl;
47pub mod ssltools;
48pub mod transport;
49pub mod proxy;
50pub mod proxy_parser;
51pub mod proxy_factory;
52pub mod communicator;
53pub mod iceobject;
54pub mod slice;
55pub mod initdata;
56pub mod properties;
57pub mod locator;
58pub mod adapter;