Struct apollo_router::Executable
source · #[non_exhaustive]pub struct Executable {}Expand description
Entry point into creating a router executable with more customization than main.
Implementations§
source§impl Executable
impl Executable
sourcepub fn builder(
) -> __ExecutableBuilder<(__Optional<Option<ShutdownSource>>, __Optional<Option<SchemaSource>>, __Optional<Option<LicenseSource>>, __Optional<Option<ConfigurationSource>>, __Optional<Option<Opt>>)>
pub fn builder( ) -> __ExecutableBuilder<(__Optional<Option<ShutdownSource>>, __Optional<Option<SchemaSource>>, __Optional<Option<LicenseSource>>, __Optional<Option<ConfigurationSource>>, __Optional<Option<Opt>>)>
Returns a builder that can parse command-line options and run a Router in an existing Tokio runtime.
Builder methods:
-
.config(impl Into<ConfigurationSource>)Optional. Specifies where to find the Router configuration. The default is the file specified by the--configor-cCLI option. -
.schema(impl Into<SchemaSource>)Optional. Specifies when to find the supergraph schema. The default is the file specified by the--supergraphor-sCLI option. -
.shutdown(impl Into<ShutdownSource>)Optional. Specifies when the Router should shut down gracefully. The default is on CTRL+C (SIGINT). -
.start()Returns a future that resolves toanyhow::Result<()>on fatal error or after graceful shutdown has completed. Must be called (and the future awaited) in the context of an existing Tokio runtime.
use apollo_router::{Executable, ShutdownSource};
use apollo_router::{ConfigurationSource, SchemaSource};
Executable::builder()
.shutdown(ShutdownSource::None)
.schema(SchemaSource::Stream(schemas))
.config(ConfigurationSource::Stream(configs))
.start()
.awaitAuto Trait Implementations§
impl RefUnwindSafe for Executable
impl Send for Executable
impl Sync for Executable
impl Unpin for Executable
impl UnwindSafe for Executable
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> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> 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