Skip to main content

DispatchInfo

Struct DispatchInfo 

Source
pub struct DispatchInfo {
Show 20 fields pub method: String, pub method_type: &'static str, pub server_id: String, pub protocol: String, pub protocol_hash: String, pub protocol_version: String, pub request_id: String, pub transport_metadata: Arc<Metadata>, pub principal: String, pub auth_domain: String, pub authenticated: bool, pub remote_addr: String, pub http_status: u16, pub request_data: Vec<u8>, pub stream_id: String, pub cancelled: bool, pub claims: BTreeMap<String, String>, pub request_bytes: Option<u64>, pub externalized_bytes: u64, pub access_sink: Option<AccessSink>,
}
Expand description

Information passed to a dispatch hook at start and end of each call.

Default exists so a hook test (or a transport that only fills a few fields) can use struct-update syntax and not be broken by a field added later; the defaults are inert, not meaningful.

Fields§

§method: String§method_type: &'static str§server_id: String§protocol: String

Logical service / protocol name.

§protocol_hash: String

SHA-256 hex of the canonical describe payload (always required in access log).

§protocol_version: String

Operator-supplied free-form protocol-contract version label (optional).

§request_id: String§transport_metadata: Arc<Metadata>

Transport-level metadata (HTTP peer addr / pipe contextvar payload).

§principal: String

Authenticated principal name, empty when anonymous.

§auth_domain: String

Authentication domain identifier, empty when anonymous.

§authenticated: bool

True when the call was authenticated.

§remote_addr: String

HTTP transport: remote IP:port. Empty otherwise.

§http_status: u16

HTTP transport: response status; 0 when not applicable.

§request_data: Vec<u8>

Self-contained Arrow IPC stream of the request batch (unary + stream init only).

§stream_id: String

Stream lifecycle identifier (32-char lowercase hex); empty on unary.

§cancelled: bool

True when a stream was cancelled by the client.

§claims: BTreeMap<String, String>

Authentication claims — e.g. decoded JWT claims, X.509 cert extensions, OAuth introspection fields. Cloned from AuthContext::claims at dispatch start. Used by the Sentry hook to enrich user / tag fields per Python 2d93987.

§request_bytes: Option<u64>

On-wire size of the request body as received, before decompression — what the peer actually sent. None on transports with no discrete request body (pipe / unix / tcp), where the framing is a continuous IPC stream rather than a message with a length.

Distinct from CallStatistics::input_bytes, which counts logical Arrow buffers after decoding and is routinely orders of magnitude larger. One figure is what egress is billed on, the other what the worker had to process.

§externalized_bytes: u64

Bytes uploaded to external storage during this call. Externalised payloads leave only a pointer batch on the wire, so transport-level accounting cannot see them at all — and they are frequently the largest of the three byte figures.

§access_sink: Option<AccessSink>

Where a hook parks a record it cannot finish yet. None means emit inline. See AccessSink.

Implementations§

Source§

impl DispatchInfo

Source

pub fn from_request( server: &RpcServer, req: &Request, method_type: &'static str, auth: &AuthContext, ) -> Self

Build a DispatchInfo from the serving server + request + resolved auth context. method_type is either "unary" or "stream".

Trait Implementations§

Source§

impl Clone for DispatchInfo

Source§

fn clone(&self) -> DispatchInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DispatchInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DispatchInfo

Source§

fn default() -> DispatchInfo

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more