Skip to main content

FwdProps

Trait FwdProps 

Source
pub trait FwdProps:
    'static
    + Clone
    + Send
    + Sync
    + for<'de> Deserialize<'de>
    + Serialize
    + Default { }
Expand description

Marker trait for types that can be forwarded as props to UI components.

Types implementing this trait can be passed through the AG-UI protocol to frontend components as properties.

§Bounds

  • 'static: Required for async operations
  • Clone: Props may need to be copied
  • Send + Sync: For thread-safe async operations
  • Serialize + Deserialize: For JSON serialization
  • Default: For initializing empty props

§Example

use ag_ui_core::FwdProps;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Serialize, Deserialize)]
struct MyProps {
    theme: String,
    locale: String,
}

impl FwdProps for MyProps {}

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FwdProps for ()

Implementors§