more docs
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 8.9 KiB |
@@ -14,3 +14,6 @@ proc-macro2 = "1.0"
|
|||||||
default = ["transport", "rustfmt"]
|
default = ["transport", "rustfmt"]
|
||||||
rustfmt = []
|
rustfmt = []
|
||||||
transport = []
|
transport = []
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
|||||||
@@ -74,3 +74,7 @@ openssl1 = { package = "openssl", version = "0.10", optional = true }
|
|||||||
|
|
||||||
# rustls
|
# rustls
|
||||||
tokio-rustls = { version = "=0.12.0-alpha.4", optional = true }
|
tokio-rustls = { version = "=0.12.0-alpha.4", optional = true }
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|||||||
+21
-13
@@ -1,16 +1,3 @@
|
|||||||
#![recursion_limit = "256"]
|
|
||||||
#![warn(
|
|
||||||
missing_debug_implementations,
|
|
||||||
missing_docs,
|
|
||||||
rust_2018_idioms,
|
|
||||||
unreachable_pub
|
|
||||||
)]
|
|
||||||
#![doc(
|
|
||||||
html_logo_url = "https://github.com/LucioFranco/tonic/raw/master/.github/assets/tonic-docs.svg?sanitize=true"
|
|
||||||
)]
|
|
||||||
#![doc(html_root_url = "https://docs.rs/tonic/0.1.0-alpha.1")]
|
|
||||||
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
|
|
||||||
|
|
||||||
//! A Rust implementation of [gRPC], a high performance, open source, general
|
//! A Rust implementation of [gRPC], a high performance, open source, general
|
||||||
//! RPC framework that puts mobile and HTTP/2 first.
|
//! RPC framework that puts mobile and HTTP/2 first.
|
||||||
//!
|
//!
|
||||||
@@ -60,6 +47,9 @@
|
|||||||
//!
|
//!
|
||||||
//! [gRPC]: https://grpc.io
|
//! [gRPC]: https://grpc.io
|
||||||
//! [`tonic`]: https://github.com/hyperium/tonic
|
//! [`tonic`]: https://github.com/hyperium/tonic
|
||||||
|
//! [`tokio`]: https://docs.rs/tokio
|
||||||
|
//! [`hyper`]: https://docs.rs/hyper
|
||||||
|
//! [`tower`]: https://docs.rs/tower
|
||||||
//! [`tonic-build`]: https://docs.rs/tonic-build
|
//! [`tonic-build`]: https://docs.rs/tonic-build
|
||||||
//! [`tonic-examples`]: https://github.com/hyperium/tonic/tree/master/tonic-examples/src
|
//! [`tonic-examples`]: https://github.com/hyperium/tonic/tree/master/tonic-examples/src
|
||||||
//! [`Codec`]: codec/trait.Codec.html
|
//! [`Codec`]: codec/trait.Codec.html
|
||||||
@@ -68,6 +58,21 @@
|
|||||||
//! [`rustls`]: https://docs.rs/rustls
|
//! [`rustls`]: https://docs.rs/rustls
|
||||||
//! [`openssl`]: https://www.openssl.org
|
//! [`openssl`]: https://www.openssl.org
|
||||||
|
|
||||||
|
#![recursion_limit = "256"]
|
||||||
|
#![warn(
|
||||||
|
missing_debug_implementations,
|
||||||
|
missing_docs,
|
||||||
|
rust_2018_idioms,
|
||||||
|
unreachable_pub
|
||||||
|
)]
|
||||||
|
#![doc(
|
||||||
|
html_logo_url = "https://github.com/LucioFranco/tonic/raw/master/.github/assets/tonic-docs.svg?sanitize=true"
|
||||||
|
)]
|
||||||
|
#![doc(html_root_url = "https://docs.rs/tonic/0.1.0-alpha.1")]
|
||||||
|
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
|
||||||
|
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
|
|
||||||
pub mod body;
|
pub mod body;
|
||||||
pub mod client;
|
pub mod client;
|
||||||
pub mod codec;
|
pub mod codec;
|
||||||
@@ -75,6 +80,7 @@ pub mod metadata;
|
|||||||
pub mod server;
|
pub mod server;
|
||||||
|
|
||||||
#[cfg(feature = "transport")]
|
#[cfg(feature = "transport")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "transport")))]
|
||||||
pub mod transport;
|
pub mod transport;
|
||||||
|
|
||||||
mod macros;
|
mod macros;
|
||||||
@@ -84,6 +90,7 @@ mod status;
|
|||||||
|
|
||||||
/// A re-export of [`async-trait`](https://docs.rs/async-trait) for use with codegen.
|
/// A re-export of [`async-trait`](https://docs.rs/async-trait) for use with codegen.
|
||||||
#[cfg(feature = "codegen")]
|
#[cfg(feature = "codegen")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "codegen")))]
|
||||||
pub use async_trait::async_trait;
|
pub use async_trait::async_trait;
|
||||||
|
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
@@ -96,4 +103,5 @@ pub(crate) type Error = Box<dyn std::error::Error + Send + Sync>;
|
|||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[cfg(feature = "codegen")]
|
#[cfg(feature = "codegen")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "codegen")))]
|
||||||
pub mod codegen;
|
pub mod codegen;
|
||||||
|
|||||||
@@ -101,6 +101,12 @@ impl Endpoint {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Enable TLS and apply the CA as the root certificate.
|
||||||
|
///
|
||||||
|
/// Providing an optional domain to override. If `None` is passed to this
|
||||||
|
/// the TLS implementation will use the `Uri` that was used to create the
|
||||||
|
/// `Endpoint` builder.
|
||||||
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// # use tonic::transport::{Certificate, Endpoint};
|
/// # use tonic::transport::{Certificate, Endpoint};
|
||||||
/// # fn dothing() -> Result<(), Box<dyn std::error::Error>> {
|
/// # fn dothing() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
@@ -114,6 +120,7 @@ impl Endpoint {
|
|||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "openssl")]
|
#[cfg(feature = "openssl")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "openssl")))]
|
||||||
pub fn openssl_tls(&mut self, ca: Certificate, domain: impl Into<Option<String>>) -> &mut Self {
|
pub fn openssl_tls(&mut self, ca: Certificate, domain: impl Into<Option<String>>) -> &mut Self {
|
||||||
let domain = domain
|
let domain = domain
|
||||||
.into()
|
.into()
|
||||||
@@ -123,6 +130,12 @@ impl Endpoint {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Enable TLS and apply the CA as the root certificate.
|
||||||
|
///
|
||||||
|
/// Providing an optional domain to override. If `None` is passed to this
|
||||||
|
/// the TLS implementation will use the `Uri` that was used to create the
|
||||||
|
/// `Endpoint` builder.
|
||||||
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// # use tonic::transport::{Certificate, Endpoint};
|
/// # use tonic::transport::{Certificate, Endpoint};
|
||||||
/// # fn dothing() -> Result<(), Box<dyn std::error::Error>> {
|
/// # fn dothing() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
@@ -136,6 +149,7 @@ impl Endpoint {
|
|||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "rustls")]
|
#[cfg(feature = "rustls")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "rustls")))]
|
||||||
pub fn rustls_tls(&mut self, ca: Certificate, domain: impl Into<Option<String>>) -> &mut Self {
|
pub fn rustls_tls(&mut self, ca: Certificate, domain: impl Into<Option<String>>) -> &mut Self {
|
||||||
let domain = domain
|
let domain = domain
|
||||||
.into()
|
.into()
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ impl Server {
|
|||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "openssl")]
|
#[cfg(feature = "openssl")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "openssl")))]
|
||||||
pub fn openssl_tls(&mut self, identity: Identity) -> &mut Self {
|
pub fn openssl_tls(&mut self, identity: Identity) -> &mut Self {
|
||||||
let acceptor = TlsAcceptor::new_with_openssl(identity).unwrap();
|
let acceptor = TlsAcceptor::new_with_openssl(identity).unwrap();
|
||||||
self.tls = Some(acceptor);
|
self.tls = Some(acceptor);
|
||||||
@@ -95,6 +96,7 @@ impl Server {
|
|||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "rustls")]
|
#[cfg(feature = "rustls")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "rustls")))]
|
||||||
pub fn rustls_tls(&mut self, identity: Identity) -> &mut Self {
|
pub fn rustls_tls(&mut self, identity: Identity) -> &mut Self {
|
||||||
let acceptor = TlsAcceptor::new_with_rustls(identity).unwrap();
|
let acceptor = TlsAcceptor::new_with_rustls(identity).unwrap();
|
||||||
self.tls = Some(acceptor);
|
self.tls = Some(acceptor);
|
||||||
|
|||||||
Reference in New Issue
Block a user