pub struct UpstreamMapRule {
pub direction: String,
pub message: String,
pub framing: String,
pub tag: Option<String>,
pub when_field: Option<String>,
pub when_value: Option<String>,
pub loc: Loc,
}Expand description
One map: projection rule: send M as json [tag "X"] /
send M as binary / receive M as json [when "f" [= "v"]] /
receive M as binary. Inbound json payloads land as §73 Json (total
navigation); the session message name is the routing + duality skeleton.
Fields§
§direction: Stringsend (axon → vendor) or receive (vendor → axon).
message: StringThe session message type this rule transcodes.
framing: Stringjson or binary (raw passthrough).
tag: Option<String>send-json only. Absent ⇒ the payload is sent VERBATIM (the vendor’s
exact wire shape, e.g. ElevenLabs {"text": …}); present ⇒ the tag
is injected as "type": "<tag>" into the payload object (the
Deepgram/OpenAI-Realtime envelope family).
when_field: Option<String>receive-json only: discriminator field. Absent ⇒ the default
equality discriminator "type" = "<MessageName>".
when_value: Option<String>receive-json only. Some(v) ⇒ equality match on when_field;
None with when_field present ⇒ field-PRESENCE match (vendors
like Gemini Live mark frame kinds by which key exists). Equality
rules dispatch before presence rules.
loc: LocTrait Implementations§
Source§impl Debug for UpstreamMapRule
impl Debug for UpstreamMapRule
Source§impl Default for UpstreamMapRule
impl Default for UpstreamMapRule
Source§fn default() -> UpstreamMapRule
fn default() -> UpstreamMapRule
Auto Trait Implementations§
impl Freeze for UpstreamMapRule
impl RefUnwindSafe for UpstreamMapRule
impl Send for UpstreamMapRule
impl Sync for UpstreamMapRule
impl Unpin for UpstreamMapRule
impl UnsafeUnpin for UpstreamMapRule
impl UnwindSafe for UpstreamMapRule
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more