Struct quartz_cli::endpoint::Endpoint
source · pub struct Endpoint {
pub url: String,
pub method: String,
pub query: HashMap<String, String>,
pub headers: HashMap<String, String>,
pub variables: HashMap<String, String>,
}Fields§
§url: String§method: StringHTTP Request method
query: HashMap<String, String>Query params.
headers: HashMap<String, String>List of (key, value) pairs.
variables: HashMap<String, String>Variable values applied from a Context
Implementations§
source§impl Endpoint
impl Endpoint
pub fn new() -> Self
pub fn name_to_dir(name: &str) -> String
pub fn from_dir(dir: PathBuf) -> Result<Self, Box<dyn Error>>
pub fn to_toml(&self) -> Result<String, Error>
pub fn body(&self, spec: &EndpointHandle) -> Body
pub fn apply_context(&mut self, context: &Context)
pub fn full_url(&self) -> Result<Uri, InvalidUri>
sourcepub fn into_request(self, spec: &EndpointHandle) -> Result<Request<Body>, Error>
pub fn into_request(self, spec: &EndpointHandle) -> Result<Request<Body>, Error>
Returns the a Request consuming struct.
pub fn colored_method(&self) -> ColoredString
sourcepub fn query_string(&self) -> String
pub fn query_string(&self) -> String
Return a query string based off of defined queries.
Example
A hash map composed of:
[query]
v = 9000
fields = "lorem,ipsum"
would return: v=9000&fields=lorem,ipsum
Trait Implementations§
source§impl<'de> Deserialize<'de> for Endpoint
impl<'de> Deserialize<'de> for Endpoint
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
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