pub struct ToolEventV1 {
pub schema_version: u16,
pub event_type: ToolEventTypeV1,
pub subscription_id: ToolEventSubscriptionId,
pub context: ToolEventContextV1,
pub data: Value,
pub extensions: BTreeMap<String, Value>,
}Expand description
Versioned, forward-compatible event envelope delivered to plugin sinks.
event_type and subscription_id are open string types and data is kept
as JSON on the envelope, so an older host can deserialize and forward an
unknown compatible variant without discarding its payload. Known consumers
use ToolEventV1::file_changed_data for the stable typed DTO.
Fields§
§schema_version: u16§event_type: ToolEventTypeV1§subscription_id: ToolEventSubscriptionId§context: ToolEventContextV1§data: Value§extensions: BTreeMap<String, Value>Additive envelope fields from a future compatible producer.
Implementations§
Source§impl ToolEventV1
impl ToolEventV1
pub fn file_changed( context: ToolEventContextV1, data: FileChangedV1, ) -> Result<Self, ToolEventBuildError>
Sourcepub fn file_changed_data(&self) -> Option<Result<FileChangedV1, Error>>
pub fn file_changed_data(&self) -> Option<Result<FileChangedV1, Error>>
Decode the stable payload only when this is the known v1 variant.
Unknown variants remain available through the public data field.
Sourcepub fn validate_bounds(&self) -> Result<(), ToolEventBuildError>
pub fn validate_bounds(&self) -> Result<(), ToolEventBuildError>
Revalidate an event before crossing a bounded publisher boundary.
Sourcepub fn validate_projection_input_bounds(
&self,
) -> Result<(), ToolEventBuildError>
pub fn validate_projection_input_bounds( &self, ) -> Result<(), ToolEventBuildError>
Validate authority-bearing fields and the known payload shape without serializing or deep-cloning producer extensions.
This is the input half of a host projection boundary: callers MUST
construct a new deny-by-default DTO and apply an exact total-byte bound
to that projection before queueing it. It is intentionally not a
replacement for Self::validate_bounds at general wire boundaries.
Trait Implementations§
Source§impl Clone for ToolEventV1
impl Clone for ToolEventV1
Source§fn clone(&self) -> ToolEventV1
fn clone(&self) -> ToolEventV1
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more