pub struct EndpointMetadata {
pub name: String,
pub method: Method,
pub path: RoutePath,
pub authorization: AuthorizationPolicy,
pub rate_limit: Option<RateLimitPolicy>,
pub timeout: Option<Duration>,
pub tags: Vec<String>,
}Expand description
Portable endpoint metadata consumed by framework adapters and documentation.
Fields§
§name: StringStable endpoint name used by diagnostics and API documentation.
method: MethodHTTP method.
path: RoutePathPortable route path.
Authorization requirement.
rate_limit: Option<RateLimitPolicy>Optional rate-limit policy.
timeout: Option<Duration>Optional request timeout.
Documentation and grouping tags.
Implementations§
Source§impl EndpointMetadata
impl EndpointMetadata
Sourcepub fn new(
name: impl Into<String>,
method: Method,
path: RoutePath,
) -> SoapResult<Self>
pub fn new( name: impl Into<String>, method: Method, path: RoutePath, ) -> SoapResult<Self>
Creates endpoint metadata with public access and no optional policies.
Sets the authorization policy.
Sourcepub fn rate_limit(self, policy: RateLimitPolicy) -> Self
pub fn rate_limit(self, policy: RateLimitPolicy) -> Self
Sets the rate-limit policy.
Sourcepub fn timeout(self, timeout: Duration) -> SoapResult<Self>
pub fn timeout(self, timeout: Duration) -> SoapResult<Self>
Sets a non-zero request timeout.
Sourcepub fn tag(self, tag: impl Into<String>) -> SoapResult<Self>
pub fn tag(self, tag: impl Into<String>) -> SoapResult<Self>
Adds a non-empty documentation tag once.
Trait Implementations§
Source§impl Clone for EndpointMetadata
impl Clone for EndpointMetadata
Source§fn clone(&self) -> EndpointMetadata
fn clone(&self) -> EndpointMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EndpointMetadata
impl Debug for EndpointMetadata
impl Eq for EndpointMetadata
Source§impl PartialEq for EndpointMetadata
impl PartialEq for EndpointMetadata
impl StructuralPartialEq for EndpointMetadata
Auto Trait Implementations§
impl Freeze for EndpointMetadata
impl RefUnwindSafe for EndpointMetadata
impl Send for EndpointMetadata
impl Sync for EndpointMetadata
impl Unpin for EndpointMetadata
impl UnsafeUnpin for EndpointMetadata
impl UnwindSafe for EndpointMetadata
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