pub struct TransformContext {
pub source: OperationKey,
pub target: OperationKey,
pub path: String,
pub query: Option<String>,
/* private fields */
}Expand description
Per-call transform settings.
path/query carry the INBOUND request target (provider-relative, as the
client sent it) for transforms that need more than the body — e.g. the
list-models query conversion. They are filled on the request direction via
with_request; response-direction contexts leave
them empty.
Fields§
§source: OperationKey§target: OperationKey§path: String§query: Option<String>Implementations§
Source§impl TransformContext
impl TransformContext
pub fn new(source: OperationKey, target: OperationKey) -> Self
Sourcepub fn with_request(self, path: &str, query: Option<&str>) -> Self
pub fn with_request(self, path: &str, query: Option<&str>) -> Self
Attach the inbound request target (request-direction contexts).
Sourcepub fn diagnostics(&self) -> Vec<TransformDiagnostic>
pub fn diagnostics(&self) -> Vec<TransformDiagnostic>
Return a snapshot of diagnostics reported through this context.
Sourcepub fn take_diagnostics(&self) -> Vec<TransformDiagnostic>
pub fn take_diagnostics(&self) -> Vec<TransformDiagnostic>
Drain diagnostics reported through this context.
Trait Implementations§
Source§impl Clone for TransformContext
impl Clone for TransformContext
Source§fn clone(&self) -> TransformContext
fn clone(&self) -> TransformContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransformContext
impl Debug for TransformContext
impl Eq for TransformContext
Auto Trait Implementations§
impl Freeze for TransformContext
impl RefUnwindSafe for TransformContext
impl Send for TransformContext
impl Sync for TransformContext
impl Unpin for TransformContext
impl UnsafeUnpin for TransformContext
impl UnwindSafe for TransformContext
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