pub struct Endpoint { /* private fields */ }Expand description
What the OpenAPI document says about one endpoint.
Implementations§
Source§impl Endpoint
impl Endpoint
Sourcepub fn description(self, text: &str) -> Self
pub fn description(self, text: &str) -> Self
A longer description, in Markdown.
Sourcepub fn operation_id(self, id: &str) -> Self
pub fn operation_id(self, id: &str) -> Self
The operation’s ID, such as orders.invoice, in place of one made from the method and path.
Tags in place of the path’s first segment.
Sourcepub const fn status(self, status: u16) -> Self
pub const fn status(self, status: u16) -> Self
The success status, when it is not 200 (or 201 for a POST that creates a resource).
Sourcepub const fn collection(self) -> Self
pub const fn collection(self) -> Self
Responds with a page of resources.
Sourcepub fn json_api_body(self, schema: Value, example: Value) -> Self
pub fn json_api_body(self, schema: Value, example: Value) -> Self
A JSON:API request body: its JSON schema and an example.
Sourcepub fn body(self, schema: Value, example: Value) -> Self
pub fn body(self, schema: Value, example: Value) -> Self
A plain JSON request body: its JSON schema and an example.
Sourcepub fn scope(self, scope: &str, description: &str) -> Self
pub fn scope(self, scope: &str, description: &str) -> Self
A scope the endpoint requires, as its RequiresScope middleware
does, and what it allows.
Leaves the endpoint out of the document.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Endpoint
impl Freeze for Endpointwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
PhantomData<(String, String)>: Freeze,
impl Move for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpointwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
impl UnwindSafe for Endpoint
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