pub struct Server { /* private fields */ }
Expand description
A gRPC server.
A single server can serve arbitrary number of services and can listen on more than one port.
Use ServerBuilder
to build a Server
.
Implementations
sourceimpl Server
impl Server
sourcepub fn shutdown(&mut self) -> ShutdownFutureⓘNotable traits for ShutdownFutureimpl Future for ShutdownFuture type Output = Result<()>;
pub fn shutdown(&mut self) -> ShutdownFutureⓘNotable traits for ShutdownFutureimpl Future for ShutdownFuture type Output = Result<()>;
Shutdown the server asynchronously.
sourcepub fn cancel_all_calls(&mut self)
pub fn cancel_all_calls(&mut self)
Cancel all in-progress calls.
Only usable after shutdown.
sourcepub fn bind_addrs(&self) -> impl ExactSizeIterator<Item = (&String, u16)>
pub fn bind_addrs(&self) -> impl ExactSizeIterator<Item = (&String, u16)>
Get binded addresses pairs.
sourcepub unsafe fn add_insecure_channel_from_fd(&self, fd: c_int)
pub unsafe fn add_insecure_channel_from_fd(&self, fd: c_int)
Add an rpc channel for an established connection represented as a file descriptor. Takes ownership of the file descriptor, closing it when channel is closed.
Safety
The file descriptor must correspond to a connected stream socket. After this call, the socket must not be accessed (read / written / closed) by other code.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Server
impl Send for Server
impl !Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
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