Struct swagger::Context
[−]
[src]
pub struct Context { pub x_span_id: Option<String>, pub authorization: Option<Authorization>, pub auth_data: Option<AuthData>, }
Request context, both as received in a server handler or as sent in a client request. When REST microservices are chained, the Context passes data from the server API to any further HTTP requests.
Fields
x_span_id: Option<String>
Tracking ID when passing a request to another microservice.
Authorization data, filled in from middlewares.
auth_data: Option<AuthData>
Raw authentication data, for use in making HTTP requests as a client.
Methods
impl Context
[src]
fn new() -> Context
Create a new, empty, Context
.
fn new_with_span_id<S: Into<String>>(x_span_id: S) -> Context
Create a Context
with a given span ID.
fn auth_basic(&mut self, username: &str, password: &str)
Set Basic authentication
fn auth_bearer(&mut self, token: &str)
Set Bearer token authentication
fn auth_apikey(&mut self, apikey: &str)
Set ApiKey authentication
Trait Implementations
impl Clone for Context
[src]
fn clone(&self) -> Context
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more