pub struct InterfaceBuilder { /* private fields */ }Expand description
Builder for creating mountable interfaces
Implementations§
Source§impl InterfaceBuilder
impl InterfaceBuilder
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set the description for this interface
Sourcepub fn route<H, T>(
self,
path: impl Into<String>,
method: HttpMethod,
handler: H,
) -> Self
pub fn route<H, T>( self, path: impl Into<String>, method: HttpMethod, handler: H, ) -> Self
Add a route to this interface
Sourcepub fn route_with_auth<H, T>(
self,
path: impl Into<String>,
method: HttpMethod,
handler: H,
auth_requirements: AuthRequirements,
) -> Self
pub fn route_with_auth<H, T>( self, path: impl Into<String>, method: HttpMethod, handler: H, auth_requirements: AuthRequirements, ) -> Self
Add a route with authentication requirements
Sourcepub fn route_with_meta<H, T>(
self,
path: impl Into<String>,
method: HttpMethod,
handler: H,
description: impl Into<String>,
tags: Vec<String>,
) -> Self
pub fn route_with_meta<H, T>( self, path: impl Into<String>, method: HttpMethod, handler: H, description: impl Into<String>, tags: Vec<String>, ) -> Self
Add a route with description and tags
Sourcepub fn route_with_full_config<H, T>(
self,
path: impl Into<String>,
method: HttpMethod,
handler: H,
auth_requirements: AuthRequirements,
description: impl Into<String>,
tags: Vec<String>,
) -> Self
pub fn route_with_full_config<H, T>( self, path: impl Into<String>, method: HttpMethod, handler: H, auth_requirements: AuthRequirements, description: impl Into<String>, tags: Vec<String>, ) -> Self
Add a route with full configuration (description, tags, and auth)
Sourcepub fn middleware(self, middleware: impl Into<String>) -> Self
pub fn middleware(self, middleware: impl Into<String>) -> Self
Add middleware to this interface
Sourcepub fn mount_options(self, options: MountOptions) -> Self
pub fn mount_options(self, options: MountOptions) -> Self
Configure mount options
Sourcepub fn default_auth_requirements(
self,
auth_requirements: AuthRequirements,
) -> Self
pub fn default_auth_requirements( self, auth_requirements: AuthRequirements, ) -> Self
Set default authentication requirements for all routes
Sourcepub fn require_auth(self) -> Self
pub fn require_auth(self) -> Self
Require authentication for all routes in this interface
Sourcepub fn require_permissions(self, permissions: Vec<String>) -> Self
pub fn require_permissions(self, permissions: Vec<String>) -> Self
Require specific permissions for all routes in this interface
Sourcepub fn build(self) -> MountableInterface
pub fn build(self) -> MountableInterface
Build the mountable interface
Auto Trait Implementations§
impl Freeze for InterfaceBuilder
impl !RefUnwindSafe for InterfaceBuilder
impl Send for InterfaceBuilder
impl Sync for InterfaceBuilder
impl Unpin for InterfaceBuilder
impl !UnwindSafe for InterfaceBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more