pub struct SlabDef {
pub method: String,
pub path: String,
pub name: String,
pub feature: String,
pub summary: String,
pub input_schema: Option<Value>,
pub output_schema: Option<Value>,
pub router: MethodRouter<AppCtx>,
}Expand description
Self-contained HTTP Transaction Script definition returned by pub fn slab() -> SlabDef.
Route paths use Axum 0.8 {param} and {*wildcard} syntax.
Fields§
§method: StringHTTP method handled by this slab (e.g. "GET", "POST").
path: StringRoute path pattern registered on the Axum router.
name: StringLogical slab name (commonly <feature>.<action>).
feature: StringFeature grouping label for manifest inspection.
summary: StringShort human-readable description of the endpoint.
input_schema: Option<Value>Optional JSON Schema describing the expected request body for OpenAPI export.
output_schema: Option<Value>Optional JSON Schema describing the response body for OpenAPI export.
router: MethodRouter<AppCtx>Axum method router wrapping the slab’s handler.
Implementations§
Source§impl SlabDef
impl SlabDef
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Set the slab’s logical name, automatically deriving feature from a <feature>.<action> prefix.
Sourcepub fn feature(self, feature: impl Into<String>) -> Self
pub fn feature(self, feature: impl Into<String>) -> Self
Explicitly set the slab’s feature group name.
Sourcepub fn summary(self, summary: impl Into<String>) -> Self
pub fn summary(self, summary: impl Into<String>) -> Self
Set a short human-readable summary for the route manifest.
Sourcepub fn input_schema(self, schema: Value) -> Self
pub fn input_schema(self, schema: Value) -> Self
Attach a JSON Schema describing the expected request body for /_slabs/openapi.json.
Sourcepub fn output_schema(self, schema: Value) -> Self
pub fn output_schema(self, schema: Value) -> Self
Attach a JSON Schema describing the response body for /_slabs/openapi.json.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SlabDef
impl !UnwindSafe for SlabDef
impl Forget for SlabDef
impl Freeze for SlabDefwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
*const dyn CloneService<Request<Body>, Error = !, Response = Response<Body>, Future = Pin<Box<dyn Future<Output = Result<Response<Body>, !>> + Send>>> + Sync + Send is !null: Freeze,
PhantomData<dyn CloneService<Request<Body>, Error = !, Response = Response<Body>, Future = Pin<Box<dyn Future<Output = Result<Response<Body>, !>> + Send>>> + Sync + Send>: Freeze,
*const dyn ErasedIntoRoute<AppCtx, !> is !null: Freeze,
PhantomData<dyn ErasedIntoRoute<AppCtx, !>>: Freeze,
*mut Shared: Freeze,
impl Move for SlabDef
impl Send for SlabDefwhere
RawVecInner: Send,
NodeRef<Owned, String, Value, LeafOrInternal>: Send,
BoxRaw<(String, Value)>: Send,
BoxRaw<dyn CloneService<Request<Body>, Error = !, Response = Response<Body>, Future = Pin<Box<dyn Future<Output = Result<Response<Body>, !>> + Send>>> + Sync + Send>: Send,
BoxRaw<dyn ErasedIntoRoute<AppCtx, !>>: Send,
BytesMut: Send,
impl Sync for SlabDefwhere
RawVecInner: Sync,
NodeRef<Owned, String, Value, LeafOrInternal>: Sync,
BoxRaw<(String, Value)>: Sync,
BoxRaw<dyn CloneService<Request<Body>, Error = !, Response = Response<Body>, Future = Pin<Box<dyn Future<Output = Result<Response<Body>, !>> + Send>>> + Sync + Send>: Sync,
BoxRaw<dyn ErasedIntoRoute<AppCtx, !>>: Sync,
BytesMut: Sync,
impl Unpin for SlabDefwhere
*const u8 is !null: Unpin,
*const LeafNode<String, Value> is !null: Unpin,
Box<(String, Value)>: Unpin,
Box<dyn CloneService<Request<Body>, Error = !, Response = Response<Body>, Future = Pin<Box<dyn Future<Output = Result<Response<Body>, !>> + Send>>> + Sync + Send>: Unpin,
Box<dyn ErasedIntoRoute<AppCtx, !>>: Unpin,
*mut Shared: Unpin,
impl UnsafeUnpin for SlabDefwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
*const dyn CloneService<Request<Body>, Error = !, Response = Response<Body>, Future = Pin<Box<dyn Future<Output = Result<Response<Body>, !>> + Send>>> + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn CloneService<Request<Body>, Error = !, Response = Response<Body>, Future = Pin<Box<dyn Future<Output = Result<Response<Body>, !>> + Send>>> + Sync + Send>: UnsafeUnpin,
*const dyn ErasedIntoRoute<AppCtx, !> is !null: UnsafeUnpin,
PhantomData<dyn ErasedIntoRoute<AppCtx, !>>: UnsafeUnpin,
*mut Shared: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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 moreSource§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> ServiceExt for T
impl<T> ServiceExt for T
Source§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Source§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
x-request-id as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
x-request-id as the header name. Read moreSource§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
413 Payload Too Large responses. Read more