pub struct ReadOp {
pub target: Target,
pub id: String,
pub routing: Option<String>,
pub protocol: Protocol,
pub trace: Option<TraceContext>,
pub forward_headers: Vec<(String, String)>,
}Expand description
A read-by-id operation against a resolved Target.
The id is already the physical id (the tenancy adapter mapped the
client’s logical id, docs/04 §5); the reader does no rewriting.
Fields§
§target: TargetThe physical destination to read from.
id: StringThe physical document id to fetch.
routing: Option<String>The _routing value (the partition id), if the placement routes.
protocol: ProtocolThe upstream wire protocol this read is dispatched over. 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. None = no
propagation header is sent.
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 ReadOp
impl ReadOp
Sourcepub fn new(
target: Target,
id: impl Into<String>,
routing: Option<String>,
) -> Self
pub fn new( target: Target, id: impl Into<String>, routing: Option<String>, ) -> Self
Constructs a read 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 ReadOp
impl StructuralPartialEq for ReadOp
Auto Trait Implementations§
impl Freeze for ReadOp
impl RefUnwindSafe for ReadOp
impl Send for ReadOp
impl Sync for ReadOp
impl Unpin for ReadOp
impl UnsafeUnpin for ReadOp
impl UnwindSafe for ReadOp
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.