pub enum BodyTransform {
None,
Inject(Vec<InjectedField>),
ConstructId(DocIdRule),
Both {
inject: Vec<InjectedField>,
id: DocIdRule,
},
}Expand description
How the request body must be transformed before it is forwarded.
For single-doc ingest the transform injects tenancy fields and/or constructs
the document _id. osproxy-rewrite performs the transform; this enum is
the instruction. Not #[non_exhaustive]: the engine must apply every
transform kind, so a new kind should force the plan builder to be updated.
§Examples
use osproxy_spi::BodyTransform;
assert!(BodyTransform::None.is_none());
assert!(!BodyTransform::Inject(vec![]).is_none());Variants§
None
Forward the body unchanged.
Inject(Vec<InjectedField>)
Inject named fields into the document.
ConstructId(DocIdRule)
Construct the _id (and optionally _routing) from a rule.
Both
Both inject fields and construct the id.
Implementations§
Trait Implementations§
Source§impl Clone for BodyTransform
impl Clone for BodyTransform
Source§fn clone(&self) -> BodyTransform
fn clone(&self) -> BodyTransform
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 BodyTransform
impl Debug for BodyTransform
impl Eq for BodyTransform
Source§impl PartialEq for BodyTransform
impl PartialEq for BodyTransform
Source§fn eq(&self, other: &BodyTransform) -> bool
fn eq(&self, other: &BodyTransform) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BodyTransform
Auto Trait Implementations§
impl Freeze for BodyTransform
impl RefUnwindSafe for BodyTransform
impl Send for BodyTransform
impl Sync for BodyTransform
impl Unpin for BodyTransform
impl UnsafeUnpin for BodyTransform
impl UnwindSafe for BodyTransform
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