pub trait NativeEvent:
Event
+ Serialize
+ DeserializeOwned
+ DeclaredFields
+ Clone {
type Full: Serialize + Clone + DeclaredFields;
type Collector;
const DIALECT: Dialect;
const DONE: bool = false;
// Required methods
fn collector(
flow: IdentityFlow,
policy: TargetIdPolicy,
limits: EventLimits,
) -> Self::Collector;
fn collect(
collector: &mut Self::Collector,
event: Self,
) -> Result<(), TransformError>;
fn collected(
collector: Self::Collector,
) -> Result<Converted<Collected<Self::Full>>, TransformError>;
fn event_name(&self) -> Option<&'static str>;
fn is_terminal(&self) -> bool;
fn tool_declarations(
&self,
complete_tool_names: bool,
) -> Vec<(String, ToolCallKind, Option<String>)>;
// Provided methods
fn responses_history(
_value: &Self::Full,
) -> Option<&GenerateContentResponseBody> { ... }
fn decode(value: Value) -> Result<Self, TransformError> { ... }
fn collect_done(
_collector: &mut Self::Collector,
) -> Result<(), TransformError> { ... }
fn is_usage_only(&self) -> bool { ... }
}Expand description
Sealed over the four actual generation event types.
Required Associated Constants§
Provided Associated Constants§
Required Associated Types§
Required Methods§
fn collector( flow: IdentityFlow, policy: TargetIdPolicy, limits: EventLimits, ) -> Self::Collector
fn collect( collector: &mut Self::Collector, event: Self, ) -> Result<(), TransformError>
fn collected( collector: Self::Collector, ) -> Result<Converted<Collected<Self::Full>>, TransformError>
fn event_name(&self) -> Option<&'static str>
fn is_terminal(&self) -> bool
Sourcefn tool_declarations(
&self,
complete_tool_names: bool,
) -> Vec<(String, ToolCallKind, Option<String>)>
fn tool_declarations( &self, complete_tool_names: bool, ) -> Vec<(String, ToolCallKind, Option<String>)>
Complete emitted ID, actual call kind, and complete name if already known.
Provided Methods§
fn responses_history( _value: &Self::Full, ) -> Option<&GenerateContentResponseBody>
fn decode(value: Value) -> Result<Self, TransformError>
fn collect_done(_collector: &mut Self::Collector) -> Result<(), TransformError>
fn is_usage_only(&self) -> bool
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".