Struct grpcio::ServerBuilder[][src]

pub struct ServerBuilder { /* fields omitted */ }
Expand description

Server factory in order to configure the properties.

Implementations

impl ServerBuilder[src]

pub fn bind_with_cred<S: Into<String>>(
    self,
    host: S,
    port: u16,
    c: ServerCredentials
) -> ServerBuilder
[src]

Bind to an address with credentials for secure connection.

This function can be called multiple times to bind to multiple ports.

pub fn bind_with_fetcher<S: Into<String>>(
    self,
    host: S,
    port: u16,
    fetcher: Box<dyn ServerCredentialsFetcher + Send + Sync>,
    cer_request_type: CertificateRequestType
) -> ServerBuilder
[src]

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.

impl ServerBuilder[src]

pub fn new(env: Arc<Environment>) -> ServerBuilder[src]

Initialize a new ServerBuilder.

pub fn bind<S: Into<String>>(self, host: S, port: u16) -> ServerBuilder[src]

Bind to an address.

This function can be called multiple times to bind to multiple ports.

pub fn channel_args(self, args: ChannelArgs) -> ServerBuilder[src]

Add additional configuration for each incoming channel.

pub fn requests_slot_per_cq(self, slots: usize) -> ServerBuilder[src]

Set how many requests a completion queue can handle.

pub fn register_service(self, service: Service) -> ServerBuilder[src]

Register a service.

pub fn add_checker<C: ServerChecker + 'static>(
    self,
    checker: C
) -> ServerBuilder
[src]

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++.

pub fn build(self) -> Result<Server>[src]

Finalize the ServerBuilder and build the Server.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.