use crate::protocol::OperationKey;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TransformContext {
pub source: OperationKey,
pub target: OperationKey,
pub path: String,
pub query: Option<String>,
}
impl TransformContext {
pub fn new(source: OperationKey, target: OperationKey) -> Self {
Self {
source,
target,
path: String::new(),
query: None,
}
}
pub fn with_request(mut self, path: &str, query: Option<&str>) -> Self {
self.path = path.to_owned();
self.query = query.map(str::to_owned);
self
}
}