pub struct AppBuilder { /* private fields */ }Implementations§
Source§impl AppBuilder
impl AppBuilder
pub fn new() -> Self
pub fn backend<I, S>(self, service: &str, urls: I) -> Self
pub fn policy(self, name: &str, policy: Policy) -> Self
pub fn default_policy(self, policy: Policy) -> Self
pub fn request_timeout(self, d: Duration) -> Self
pub fn connect_timeout(self, d: Duration) -> Self
pub fn pool_idle_timeout(self, d: Duration) -> Self
pub fn map_body_limit(self, bytes: usize) -> Self
pub fn state<T: Clone + Send + Sync + 'static>(self, val: T) -> Self
Sourcepub fn error_renderer<F>(self, renderer: F) -> Self
pub fn error_renderer<F>(self, renderer: F) -> Self
Sets the renderer for framework-generated errors (ApigateError::* constructors).
This lets applications return a uniform JSON error envelope instead of plain text. The renderer is used both for pipeline errors and proxy/runtime errors (502/504, etc.).
pub fn mount(self, routes: Routes) -> Self
Sourcepub fn mount_service<I, S>(self, routes: Routes, urls: I) -> Self
pub fn mount_service<I, S>(self, routes: Routes, urls: I) -> Self
Registers backend URLs for routes.service and mounts these routes.
Equivalent to:
builder.backend(routes.service, urls).mount(routes)
pub fn build(self) -> Result<App, ApigateBuildError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppBuilder
impl !RefUnwindSafe for AppBuilder
impl Send for AppBuilder
impl Sync for AppBuilder
impl Unpin for AppBuilder
impl UnsafeUnpin for AppBuilder
impl !UnwindSafe for AppBuilder
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
Mutably borrows from an owned value. Read more