pub struct WriteOp {
pub target: Target,
pub doc: DocOp,
pub epoch: Epoch,
pub protocol: Protocol,
pub trace: Option<TraceContext>,
pub forward_headers: Vec<(String, String)>,
}Expand description
A single write operation against a resolved Target.
Carries the epoch the routing decision was derived from, stamped here so the
sink (or a future migration-aware backend) can reject a stale-epoch write
(docs/06 §2). For M1 the epoch is recorded and forwarded; stale-epoch
rejection arrives with migration in M5.
Fields§
§target: TargetThe physical destination of this operation.
doc: DocOpThe document operation to perform.
epoch: EpochThe placement epoch this write was resolved against.
protocol: ProtocolThe upstream wire protocol this op is dispatched over (per-request,
docs/04 §7). Defaults to Protocol::Http1.
trace: Option<TraceContext>The W3C trace context to forward downstream (traceparent), so the
upstream’s spans join this request’s distributed trace.
forward_headers: Vec<(String, String)>Client headers to relay verbatim to the upstream (the forwarding policy’s
output). Applied before trace. Empty by default.
Implementations§
Source§impl WriteOp
impl WriteOp
Sourcepub fn new(target: Target, doc: DocOp, epoch: Epoch) -> Self
pub fn new(target: Target, doc: DocOp, epoch: Epoch) -> Self
Constructs a write operation (defaulting to HTTP/1.1 upstream).
Sourcepub fn with_protocol(self, protocol: Protocol) -> Self
pub fn with_protocol(self, protocol: Protocol) -> Self
Sets the upstream protocol for this op (builder style).
Sourcepub fn with_trace(self, trace: Option<TraceContext>) -> Self
pub fn with_trace(self, trace: Option<TraceContext>) -> Self
Sets the trace context to propagate downstream (builder style).
Sourcepub fn with_forward_headers(self, headers: Vec<(String, String)>) -> Self
pub fn with_forward_headers(self, headers: Vec<(String, String)>) -> Self
Sets the client headers to relay verbatim to the upstream (builder style).
Trait Implementations§
impl Eq for WriteOp
impl StructuralPartialEq for WriteOp
Auto Trait Implementations§
impl !Freeze for WriteOp
impl RefUnwindSafe for WriteOp
impl Send for WriteOp
impl Sync for WriteOp
impl Unpin for WriteOp
impl UnsafeUnpin for WriteOp
impl UnwindSafe for WriteOp
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.