pub struct EndpointSpec {Show 14 fields
pub method: Option<HttpMethod>,
pub path: Option<String>,
pub auth: Option<AuthRule>,
pub input: Option<Vec<String>>,
pub filters: Option<Vec<String>>,
pub search: Option<Vec<String>>,
pub pagination: Option<PaginationStyle>,
pub sort: Option<Vec<String>>,
pub cache: Option<CacheSpec>,
pub controller: Option<ControllerSpec>,
pub events: Option<Vec<String>>,
pub jobs: Option<Vec<String>>,
pub upload: Option<UploadSpec>,
pub soft_delete: bool,
}Expand description
Specification for a single endpoint in a resource.
Matches the YAML format:
list:
method: GET
path: /users
auth: [member, admin]
pagination: cursorWhen the endpoint name matches a known convention (list, get, create, update, delete),
method and path can be omitted and will be inferred from the resource name.
Use apply_endpoint_defaults() after parsing to fill them in.
Fields§
§method: Option<HttpMethod>HTTP method (GET, POST, PATCH, PUT, DELETE). Optional when endpoint name is a known convention (list, get, create, update, delete).
path: Option<String>URL path pattern (e.g., “/users”, “/users/:id”). Optional when endpoint name is a known convention (list, get, create, update, delete).
auth: Option<AuthRule>Authentication/authorization rule.
input: Option<Vec<String>>Fields accepted as input for create/update.
filters: Option<Vec<String>>Fields available as query filters.
search: Option<Vec<String>>Fields included in full-text search.
pagination: Option<PaginationStyle>Pagination style for list endpoints.
sort: Option<Vec<String>>Fields available for sorting.
cache: Option<CacheSpec>Cache configuration.
controller: Option<ControllerSpec>Controller functions for synchronous in-request business logic.
events: Option<Vec<String>>Events to emit after successful execution.
jobs: Option<Vec<String>>Background jobs to enqueue after successful execution.
upload: Option<UploadSpec>File upload configuration.
soft_delete: boolWhether this endpoint performs a soft delete.
Implementations§
Source§impl EndpointSpec
impl EndpointSpec
Trait Implementations§
Source§impl Clone for EndpointSpec
impl Clone for EndpointSpec
Source§fn clone(&self) -> EndpointSpec
fn clone(&self) -> EndpointSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointSpec
impl Debug for EndpointSpec
Source§impl<'de> Deserialize<'de> for EndpointSpec
impl<'de> Deserialize<'de> for EndpointSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for EndpointSpec
impl PartialEq for EndpointSpec
Source§impl Serialize for EndpointSpec
impl Serialize for EndpointSpec
impl StructuralPartialEq for EndpointSpec
Auto Trait Implementations§
impl Freeze for EndpointSpec
impl RefUnwindSafe for EndpointSpec
impl Send for EndpointSpec
impl Sync for EndpointSpec
impl Unpin for EndpointSpec
impl UnsafeUnpin for EndpointSpec
impl UnwindSafe for EndpointSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more