pub struct Operation<In, Out> {
pub id: String,
pub method: String,
pub title: String,
pub description: String,
pub allowed_roles: Vec<String>,
pub tags: Vec<String>,
pub read_only: bool,
pub visible: Option<bool>,
/* private fields */
}Expand description
Describes one statically declared executable operation.
Fields§
§id: StringStable operation id.
method: StringHTTP method advertised in the catalog.
title: StringHuman-readable title.
description: StringHuman-readable description.
allowed_roles: Vec<String>Host-side roles allowed to invoke the operation.
Free-form catalog tags.
read_only: boolWhether the operation is read-only.
visible: Option<bool>Optional catalog visibility override.
Implementations§
Source§impl<In, Out> Operation<In, Out>where
In: JsonSchema,
Out: JsonSchema,
impl<In, Out> Operation<In, Out>where
In: JsonSchema,
Out: JsonSchema,
Sourcepub fn new(id: impl Into<String>) -> Self
pub fn new(id: impl Into<String>) -> Self
Creates a new operation definition with the supplied stable id.
Sourcepub fn method(self, method: impl AsRef<str>) -> Self
pub fn method(self, method: impl AsRef<str>) -> Self
Overrides the HTTP verb advertised in the derived catalog.
Sourcepub fn title(self, title: impl Into<String>) -> Self
pub fn title(self, title: impl Into<String>) -> Self
Sets the human-readable title shown in the derived catalog.
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Sets the human-readable description shown in the derived catalog.
Sourcepub fn allowed_roles(self, allowed_roles: impl Into<Vec<String>>) -> Self
pub fn allowed_roles(self, allowed_roles: impl Into<Vec<String>>) -> Self
Restricts the operation to the supplied host-side roles.
Attaches free-form tags to the derived catalog entry.
Trait Implementations§
Auto Trait Implementations§
impl<In, Out> Freeze for Operation<In, Out>
impl<In, Out> RefUnwindSafe for Operation<In, Out>where
In: RefUnwindSafe,
Out: RefUnwindSafe,
impl<In, Out> Send for Operation<In, Out>
impl<In, Out> Sync for Operation<In, Out>
impl<In, Out> Unpin for Operation<In, Out>
impl<In, Out> UnsafeUnpin for Operation<In, Out>
impl<In, Out> UnwindSafe for Operation<In, Out>where
In: UnwindSafe,
Out: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request