pub struct ExtraArgs {
pub headers: Vec<(String, String)>,
pub query: Vec<(String, String)>,
pub body: Vec<(String, String)>,
}Expand description
Extra arguments for HTTP requests that can override or supplement the base configuration from profiles.
This structure allows users to provide additional headers, query parameters, and body parameters that will be merged with the profile configuration.
§Examples
use xdiff_live::ExtraArgs;
// Create extra args with custom headers
let extra = ExtraArgs::new_with_headers(vec![
("Authorization".to_string(), "Bearer token123".to_string()),
("User-Agent".to_string(), "MyApp/1.0".to_string()),
]);
// Create extra args with query parameters
let extra = ExtraArgs::new_with_query(vec![
("page".to_string(), "1".to_string()),
("limit".to_string(), "50".to_string()),
]);Fields§
§headers: Vec<(String, String)>Additional HTTP headers to include in the request
query: Vec<(String, String)>Additional query parameters to include in the request URL
body: Vec<(String, String)>Additional body parameters to include in the request body
Implementations§
Source§impl ExtraArgs
impl ExtraArgs
Sourcepub fn new_with_headers(headers: Vec<(String, String)>) -> Self
pub fn new_with_headers(headers: Vec<(String, String)>) -> Self
Sourcepub fn new_with_query(query: Vec<(String, String)>) -> Self
pub fn new_with_query(query: Vec<(String, String)>) -> Self
Creates a new ExtraArgs instance with only query parameters specified.
§Arguments
query- A vector of key-value pairs representing query parameters
§Examples
use xdiff_live::ExtraArgs;
let extra = ExtraArgs::new_with_query(vec![
("search".to_string(), "rust".to_string()),
("page".to_string(), "1".to_string()),
]);Sourcepub fn new_with_body(body: Vec<(String, String)>) -> Self
pub fn new_with_body(body: Vec<(String, String)>) -> Self
Creates a new ExtraArgs instance with only body parameters specified.
§Arguments
body- A vector of key-value pairs representing body parameters
§Examples
use xdiff_live::ExtraArgs;
let extra = ExtraArgs::new_with_body(vec![
("username".to_string(), "john_doe".to_string()),
("email".to_string(), "john@example.com".to_string()),
]);Trait Implementations§
impl Eq for ExtraArgs
Source§impl From<Vec<KeyVal>> for ExtraArgs
impl From<Vec<KeyVal>> for ExtraArgs
Source§fn from(args: Vec<KeyVal>) -> Self
fn from(args: Vec<KeyVal>) -> Self
Converts a vector of KeyVal items into an ExtraArgs structure.
This implementation groups the key-value pairs by their type and creates separate vectors for headers, query parameters, and body parameters.
§Arguments
args- A vector ofKeyValitems to be converted
§Returns
An ExtraArgs structure with the key-value pairs organized by type.
§Examples
use xdiff_live::cli::{KeyVal, KeyValType};
use xdiff_live::ExtraArgs;
let kv_pairs = vec![
KeyVal { /* query param */ },
KeyVal { /* header param */ },
KeyVal { /* body param */ },
];
let extra_args: ExtraArgs = kv_pairs.into();impl StructuralPartialEq for ExtraArgs
Auto Trait Implementations§
impl Freeze for ExtraArgs
impl RefUnwindSafe for ExtraArgs
impl Send for ExtraArgs
impl Sync for ExtraArgs
impl Unpin for ExtraArgs
impl UnsafeUnpin for ExtraArgs
impl UnwindSafe for ExtraArgs
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.