pub struct Endpoint {
Show 20 fields pub route: String, pub method: String, pub payload_struct: Option<String>, pub query_struct: Option<String>, pub result_ok_status: String, pub result_ko_status: Vec<EndpointStatus>, pub result_struct: String, pub result_multiple: bool, pub result_is_stream: bool, pub cli_route: String, pub cli_help: Option<String>, pub cli_long_help: Option<String>, pub cli_visible_aliases: Option<VecStringWrapper>, pub cli_long_flag_aliases: Option<VecStringWrapper>, pub cli_aliases: Option<VecStringWrapper>, pub cli_short_flag_aliases: Option<VecStringWrapper>, pub cli_no_output: bool, pub cli_output_formats: Option<VecStringWrapper>, pub cli_force_output_format: bool, pub config: Vec<ApiInputConfig>,
}
Expand description

Specify an Http endpoint

Fields§

§route: String

Absolute route as format template Variables are written in curly braces {}.

Examples:

/root/{id}/sub/{arg}
§method: String§payload_struct: Option<String>§query_struct: Option<String>§result_ok_status: String

Expected status if query is ok

§result_ko_status: Vec<EndpointStatus>§result_struct: String§result_multiple: bool

returns a list of results

§result_is_stream: bool

returns a stream of bytes for this endpoint This flag generates the --output arguments. This flag disables the --format arguments.

§cli_route: String

clap route separated by slash (/)

Variables should match the variables declared in the route configuration.

/command/{id}/subcommand/{arg}
§cli_help: Option<String>

Short help string for this endpoint

§cli_long_help: Option<String>

Long help string for this endpoint.

§cli_visible_aliases: Option<VecStringWrapper>§cli_long_flag_aliases: Option<VecStringWrapper>§cli_aliases: Option<VecStringWrapper>§cli_short_flag_aliases: Option<VecStringWrapper>§cli_no_output: bool

This empty have no output to display. It can be combined with the EmptyResponse result structure.

Examples:

endpoint(
  result_ok_status = "NO_CONTENT",
  cli_no_output,
  result_struct = "EmptyResponse",
  route = "...",
  cli_route = "...",
),
§cli_output_formats: Option<VecStringWrapper>§cli_force_output_format: bool

Force the generation of ‘–format’ args in variable sub command. There’s cases where the arg is not generated automatically.

Example:

/route/{var}'

By default, {var} don’t generate --format. If route is just a passthrough, you need the cli_force_output_format to generate the --format args.

§config: Vec<ApiInputConfig>

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
Create an instance from a list of nested meta items.
Create an instance from a syn::Meta by dispatching to the format-appropriate trait function. This generally should not be overridden by implementers. Read more
When a field is omitted from a parent meta-item, from_none is used to attempt recovery before a missing field error is generated. Read more
Create an instance from the presence of the word in the attribute with no additional options specified.
Create an instance from a literal value of either foo = "bar" or foo("bar"). This dispatches to the appropriate method based on the type of literal encountered, and generally should not be overridden by implementers. Read more
Create an instance from a char literal in a value position.
Create an instance from a string literal in a value position.
Create an instance from a bool literal in a value position.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.