Struct grpcio::ServerBuilder
source · [−]pub struct ServerBuilder { /* private fields */ }
Expand description
Server
factory in order to configure the properties.
Implementations
sourceimpl ServerBuilder
impl ServerBuilder
sourcepub fn bind_with_cred<S: Into<String>>(
self,
host: S,
port: u16,
c: ServerCredentials
) -> ServerBuilder
pub fn bind_with_cred<S: Into<String>>(
self,
host: S,
port: u16,
c: ServerCredentials
) -> ServerBuilder
Bind to an address with credentials for secure connection.
This function can be called multiple times to bind to multiple ports.
sourcepub fn bind_with_fetcher<S: Into<String>>(
self,
host: S,
port: u16,
fetcher: Box<dyn ServerCredentialsFetcher + Send + Sync>,
cer_request_type: CertificateRequestType
) -> ServerBuilder
pub fn bind_with_fetcher<S: Into<String>>(
self,
host: S,
port: u16,
fetcher: Box<dyn ServerCredentialsFetcher + Send + Sync>,
cer_request_type: CertificateRequestType
) -> ServerBuilder
Bind to an address for secure connection.
The required credentials will be fetched using provided fetcher
. This
function can be called multiple times to bind to multiple ports.
sourceimpl ServerBuilder
impl ServerBuilder
sourcepub fn new(env: Arc<Environment>) -> ServerBuilder
pub fn new(env: Arc<Environment>) -> ServerBuilder
Initialize a new ServerBuilder
.
sourcepub fn bind<S: Into<String>>(self, host: S, port: u16) -> ServerBuilder
pub fn bind<S: Into<String>>(self, host: S, port: u16) -> ServerBuilder
Bind to an address.
This function can be called multiple times to bind to multiple ports.
sourcepub fn channel_args(self, args: ChannelArgs) -> ServerBuilder
pub fn channel_args(self, args: ChannelArgs) -> ServerBuilder
Add additional configuration for each incoming channel.
sourcepub fn requests_slot_per_cq(self, slots: usize) -> ServerBuilder
pub fn requests_slot_per_cq(self, slots: usize) -> ServerBuilder
Set how many requests a completion queue can handle.
sourcepub fn register_service(self, service: Service) -> ServerBuilder
pub fn register_service(self, service: Service) -> ServerBuilder
Register a service.
sourcepub fn add_checker<C: ServerChecker + 'static>(
self,
checker: C
) -> ServerBuilder
pub fn add_checker<C: ServerChecker + 'static>(
self,
checker: C
) -> ServerBuilder
Add a custom checker to handle some tasks before the grpc call handler starts. This allows users to operate grpc call based on the context. Users can add multiple checkers and they will be executed in the order added.
TODO: Extend this interface to intercepte each payload like grpc-c++.
Auto Trait Implementations
impl !RefUnwindSafe for ServerBuilder
impl !Send for ServerBuilder
impl !Sync for ServerBuilder
impl Unpin for ServerBuilder
impl !UnwindSafe for ServerBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more