1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! This module provides the ability to set some options at call time.
//! These options also only apply to the call once.
//!
//! Note: If you set a [`CallOpt`] to a [`Client`][super::Client] and clones it,
//! the [`CallOpt`] will be discarded.
//!
//! # Example
//!
//! ```rust,ignore
//! use volo_thrift::client::CallOpt;
//!
//! static CLIENT: LazyLock<volo_gen::volo::example::item::ItemServiceClient> = LazyLock::new(|| {
//! let addr: SocketAddr = "127.0.0.1:8080".parse().unwrap();
//! volo_gen::volo::example::item::ItemServiceClientBuilder::new("volo-example-item")
//! .layer(LogLayer)
//! .target(addr)
//! .build()
//! })
//!
//! #[volo::main]
//! async fn main() {
//! let callopt = CallOpt::default();
//! // Do something with callopt here
//! ...
//! let req = volo_gen::volo::example::item::GetItemRequest { id: 1024 };
//! let resp = CLIENT.clone().get_item(req).await;
//! match resp {
//! Ok(info) => tracing::info!("{:?}", info),
//! Err(e) => tracing::error!("{:?}", e),
//! }
//! }
//! ```
use ;
use Address;
use crateConfig;