Struct crud_api_endpoint::ApiRun
source · pub struct ApiRun {
pub infos: ApiInformation,
pub extra_header: Vec<Header>,
/* private fields */
}
Expand description
Attribute used by #[derive(ApiRun)]
.
It declare a new cli application:
- create the cli
- handle the command
It can take parameters by #[api(...)]
.
Only one #[derive(ApiRun)]
should be present in your application.
Fields§
§infos: ApiInformation
Information block of the application.
Example
#[api(infos(
base_url = "http://jsonplaceholder.typicode.com",
name = "jsonplaceholder",
qualifier = "com",
organisation = "typicode",
env_prefix = "JSONPLACEHOLDER"
))]
extra_header: Vec<Header>
Name of the struct derived by ApiRun
.
Used to implentent the run
function.
Add extra header to all endpoints.
Trait Implementations§
source§impl FromDeriveInput for ApiRun
impl FromDeriveInput for ApiRun
source§fn from_derive_input(__di: &DeriveInput) -> Result<Self>
fn from_derive_input(__di: &DeriveInput) -> Result<Self>
Create an instance from
syn::DeriveInput
, or return an error.Auto Trait Implementations§
impl RefUnwindSafe for ApiRun
impl !Send for ApiRun
impl !Sync for ApiRun
impl Unpin for ApiRun
impl UnwindSafe for ApiRun
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