pub struct TrustTaskRouter<S = ()> { /* private fields */ }Expand description
Builder that wraps an Axum Router and enforces Trust-Task
header validation on each registered route.
Implementations§
Source§impl<S> TrustTaskRouter<S>
impl<S> TrustTaskRouter<S>
Sourcepub fn route_with_task(
self,
path: &str,
method_router: MethodRouter<S>,
task: TrustTask,
) -> Self
pub fn route_with_task( self, path: &str, method_router: MethodRouter<S>, task: TrustTask, ) -> Self
Register a route whose incoming Trust-Task header must
exact-match task. Mismatch → 415
AppError::TrustTaskMismatch; missing → 400
AppError::TrustTaskMissing.
Sourcepub fn route_exempt(self, path: &str, method_router: MethodRouter<S>) -> Self
pub fn route_exempt(self, path: &str, method_router: MethodRouter<S>) -> Self
Register a route that bypasses Trust-Task validation. Per spec
§16.2 this is intended only for /health — operators set
up monitoring against the health endpoint without having to
know about Trust-Task identifiers. Documented as the single
exempt route; if you find yourself reaching for this for a
second endpoint, stop and add a Trust Task instead.
Sourcepub fn into_router(self) -> Router<S>
pub fn into_router(self) -> Router<S>
Finalise and yield the underlying Router ready to be
merged or nested into a parent router.
Trait Implementations§
Source§impl<S> Default for TrustTaskRouter<S>
impl<S> Default for TrustTaskRouter<S>
Auto Trait Implementations§
impl<S = ()> !RefUnwindSafe for TrustTaskRouter<S>
impl<S = ()> !UnwindSafe for TrustTaskRouter<S>
impl<S> Freeze for TrustTaskRouter<S>
impl<S> Send for TrustTaskRouter<S>
impl<S> Sync for TrustTaskRouter<S>
impl<S> Unpin for TrustTaskRouter<S>
impl<S> UnsafeUnpin for TrustTaskRouter<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
Mutably borrows from an owned value. Read more
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Clear for Twhere
T: InitializableFromZeroed + ?Sized,
impl<T> Clear for Twhere
T: InitializableFromZeroed + ?Sized,
Source§impl<T> InitializableFromZeroed for Twhere
T: Default,
impl<T> InitializableFromZeroed for Twhere
T: Default,
Source§unsafe fn initialize(place: *mut T)
unsafe fn initialize(place: *mut T)
Called to initialize a place to a valid value, after it is set
to all-bits-zero. 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, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
Returns a reference to the resource of type
T.