Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/generated/helloworld/helloworld_grpc.pb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pub mod greeter_client {
use grpc::client::*;
use grpc_protobuf::*;
use grpc_protobuf::client::*;
/// The greeting service definition.
#[derive(Debug, Clone)]
pub struct GreeterClient<T> {
Expand Down
1 change: 1 addition & 0 deletions examples/generated/routeguide/route_guide_grpc.pb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pub mod route_guide_client {
use grpc::client::*;
use grpc_protobuf::*;
use grpc_protobuf::client::*;
/// Interface exported by the server.
#[derive(Debug, Clone)]
pub struct RouteGuideClient<T> {
Expand Down
6 changes: 3 additions & 3 deletions grpc-protobuf/src/client/bidi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ use protobuf::Message;
use protobuf::MessageMut;
use protobuf::MessageView;

use crate::CallBuilder;
use crate::GrpcStreamingRequest;
use crate::GrpcStreamingResponse;
use crate::client::CallBuilder;
use crate::client::GrpcStreamingRequest;
use crate::client::GrpcStreamingResponse;
use crate::private::Internal;

/// Configures a bidirectional call for gRPC Protobuf. Implements
Expand Down
2 changes: 1 addition & 1 deletion grpc-protobuf/src/client/client_streaming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ use protobuf::Message;
use protobuf::MessageMut;
use protobuf::MessageView;

use crate::CallBuilder;
use crate::ProtoRecvMessage;
use crate::ProtoSendMessage;
use crate::Status;
use crate::StatusOr;
use crate::client::CallBuilder;
use crate::client::Internal;
use crate::trailers_conv::status_from_trailers;

Expand Down
13 changes: 9 additions & 4 deletions grpc-protobuf/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ use crate::Status;
use crate::private::Internal;
use crate::trailers_conv::status_from_trailers;

pub(crate) mod bidi;
pub(crate) mod client_streaming;
pub(crate) mod server_streaming;
pub(crate) mod unary;
mod bidi;
mod client_streaming;
mod server_streaming;
mod unary;

pub use bidi::*;
pub use client_streaming::*;
pub use server_streaming::*;
pub use unary::*;

/// Allows sending streaming RPC protobuf request messages.
///
Expand Down
4 changes: 2 additions & 2 deletions grpc-protobuf/src/client/server_streaming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ use protobuf::MessageMut;
use protobuf::MessageView;
use protobuf::Proxied;

use crate::CallBuilder;
use crate::GrpcStreamingResponse;
use crate::ProtoSendMessage;
use crate::client::CallBuilder;
use crate::client::GrpcStreamingResponse;
use crate::client::Internal;

/// Configures a server-streaming call for gRPC Protobuf. Implements
Expand Down
2 changes: 1 addition & 1 deletion grpc-protobuf/src/client/unary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ use protobuf::Message;
use protobuf::MessageView;
use protobuf::Proxied;

use crate::CallBuilder;
use crate::ProtoRecvMessage;
use crate::ProtoSendMessage;
use crate::Status;
use crate::StatusError;
use crate::client::CallBuilder;
use crate::client::Internal;
use crate::trailers_conv::status_from_trailers;

Expand Down
17 changes: 6 additions & 11 deletions grpc-protobuf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
//! There are four basic RPC (Remote Procedure Call) types and a corresponding
//! call builder for each.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all assuming client-side stuff only and will want to be rewritten at least when we add the server symbols, or now if you want to do it. We can either document all the client and server stuff together in here, or we can move this into the client module and leave something else useful behind for the top level.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the docs to the client module and added a Modules section in its place, similar to the grpc crate.

//!
//! * Unary: [`UnaryCallBuilder`]
//! * Client Streaming: [`ClientStreamingCallBuilder`]
//! * Server Streaming: [`ServerStreamingCallBuilder`]
//! * Bidirectional Streaming: [`BidiCallBuilder`]
//! * Unary: [`client::UnaryCallBuilder`]
//! * Client Streaming: [`client::ClientStreamingCallBuilder`]
//! * Server Streaming: [`client::ServerStreamingCallBuilder`]
//! * Bidirectional Streaming: [`client::BidiCallBuilder`]
//!
//! Each call builder implements [`CallBuilder`] which can be used to configure
//! Each call builder implements [`client::CallBuilder`] which can be used to configure
//! the call. Each one also provides an [`IntoFuture`] implementation to
//! actually begin the call. See the documentation for each type for additional
//! usage information.
Expand All @@ -58,14 +58,9 @@ use protobuf::MutProxied;
use protobuf::Proxied;
use protobuf::Serialize;

mod client;
pub mod client;
mod status;
mod trailers_conv;
pub use client::bidi::*;
pub use client::client_streaming::*;
pub use client::server_streaming::*;
pub use client::unary::*;
pub use client::*;
pub use status::*;

/// Implements [`SendMessage`] for protobuf message views.
Expand Down
2 changes: 1 addition & 1 deletion interop/src/client_protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ use grpc::client::metadata_utils::CaptureHeadersInterceptor;
use grpc::client::metadata_utils::CaptureTrailersInterceptor;
use grpc::metadata::MetadataMap;
use grpc::metadata::MetadataValue;
use grpc_protobuf::CallBuilder;
use grpc_protobuf::StatusCodeError;
use grpc_protobuf::StatusOr;
use grpc_protobuf::client::CallBuilder;
use protobuf::message_eq;
use protobuf::proto;
use tonic::async_trait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ static void GenerateClient(const Service &service, Printer &printer,
pub mod $client_mod$ {
use grpc::client::*;
use grpc_protobuf::*;
use grpc_protobuf::client::*;

$service_doc$
#[derive(Debug, Clone)]
Expand Down
Loading