Macro aws_smithy_http_server::scope

source ·
macro_rules! scope {
    (
        $(#[$attrs:meta])*
        $vis:vis struct $name:ident {
            includes: [$($include:ty),*],
            excludes: [$($exclude:ty),*]
        }
    ) => { ... };
}
Expand description

A macro to help with scoping plugins to a subset of all operations.

The scope must partition all operations, that is, each and every operation must be included or excluded, but not both.

The generated server SDK exports a similar scope macro which is aware of a service’s operations and can complete underspecified scopes automatically.

§Example

For a service with three operations: OperationA, OperationB, OperationC.

scope! {
    struct OnlyAB {
        includes: [OperationA, OperationB],
        excludes: [OperationC]
    }
}