pub struct Server<S>where
S: Storage,{ /* private fields */ }
Expand description
A running server instance.
Implementations§
Source§impl<S> Server<S>where
S: Storage,
impl<S> Server<S>where
S: Storage,
Sourcepub fn spawn(storage: S, options: ServerOptions) -> Result<Self>
pub fn spawn(storage: S, options: ServerOptions) -> Result<Self>
Start a new server with the given storage backend and options.
The server will spawn backgrounds tasks that will run until the server is stopped.
Sourcepub fn admin_service(&self) -> impl AdminService
pub fn admin_service(&self) -> impl AdminService
Get a handle to the admin gRPC service.
Sourcepub fn executor_service(&self) -> impl ExecutorService
pub fn executor_service(&self) -> impl ExecutorService
Get a handle to the executor service.
Sourcepub fn admin_service_client(&self) -> AdminServiceClient<Channel>
pub fn admin_service_client(&self) -> AdminServiceClient<Channel>
Get an admin service client that connects to the server using an in-memory transport.
Make sure to reuse the client as every call to this function will spawn a new task that is only cleaned up once the server is dropped.
Sourcepub fn executor_service_client(&self) -> ExecutorServiceClient<Channel>
pub fn executor_service_client(&self) -> ExecutorServiceClient<Channel>
Get an executor service client that connects to the server using an in-memory transport.
Make sure to reuse the client as every call to this function will spawn a new task that is only cleaned up once the server is dropped.
Sourcepub fn options(&self) -> &ServerOptions
pub fn options(&self) -> &ServerOptions
Get the server options.
Source§impl<S> Server<S>where
S: Storage + StorageSnapshot,
impl<S> Server<S>where
S: Storage + StorageSnapshot,
Sourcepub fn snapshot_service(&self) -> impl SnapshotService
pub fn snapshot_service(&self) -> impl SnapshotService
Get a handle to the snapshot service.
Sourcepub fn snapshot_service_client(&self) -> SnapshotServiceClient<Channel>
pub fn snapshot_service_client(&self) -> SnapshotServiceClient<Channel>
Get a snapshot service client that connects to the server using an in-memory transport.
Make sure to reuse the client as every call to this function will spawn a new task that is only cleaned up once the server is dropped.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Server<S>where
S: Freeze,
impl<S> !RefUnwindSafe for Server<S>
impl<S> Send for Server<S>
impl<S> Sync for Server<S>
impl<S> Unpin for Server<S>where
S: Unpin,
impl<S> !UnwindSafe for Server<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request