pub struct BodyMutation {
pub data: Option<String>,
pub chunk_index: u32,
}Expand description
Body mutation from agent
Allows agents to modify body content during streaming:
Nonedata: pass through original chunk unchangedSome(empty): drop the chunk entirelySome(data): replace chunk with modified content
Fields§
§data: Option<String>Modified body data (base64 encoded for JSON transport)
None: use original chunk unchangedSome(""): drop this chunkSome(data): replace chunk with this data
chunk_index: u32Chunk index this mutation applies to
Must match the chunk_index from the body chunk event.
Implementations§
Source§impl BodyMutation
impl BodyMutation
Sourcepub fn pass_through(chunk_index: u32) -> Self
pub fn pass_through(chunk_index: u32) -> Self
Create a pass-through mutation (no change)
Sourcepub fn drop_chunk(chunk_index: u32) -> Self
pub fn drop_chunk(chunk_index: u32) -> Self
Create a mutation that drops the chunk
Sourcepub fn replace(chunk_index: u32, data: String) -> Self
pub fn replace(chunk_index: u32, data: String) -> Self
Create a mutation that replaces the chunk
Sourcepub fn is_pass_through(&self) -> bool
pub fn is_pass_through(&self) -> bool
Check if this mutation passes through unchanged
Trait Implementations§
Source§impl Clone for BodyMutation
impl Clone for BodyMutation
Source§fn clone(&self) -> BodyMutation
fn clone(&self) -> BodyMutation
Returns a duplicate of the value. Read more
1.0.0 · 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 BodyMutation
impl Debug for BodyMutation
Source§impl<'de> Deserialize<'de> for BodyMutation
impl<'de> Deserialize<'de> for BodyMutation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BodyMutation
impl PartialEq for BodyMutation
Source§impl Serialize for BodyMutation
impl Serialize for BodyMutation
impl Eq for BodyMutation
impl StructuralPartialEq for BodyMutation
Auto Trait Implementations§
impl Freeze for BodyMutation
impl RefUnwindSafe for BodyMutation
impl Send for BodyMutation
impl Sync for BodyMutation
impl Unpin for BodyMutation
impl UnwindSafe for BodyMutation
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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
Compare self to
key and return true if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request