EntityData

Trait EntityData 

Source
pub trait EntityData:
    Serialize
    + DeserializeOwned
    + Clone
    + Send
    + Sync
    + 'static {
    type Entity: Entity<Data = Self>;
}
Expand description

Trait that maps a Data type back to its Entity type.

This enables type inference from return type instead of requiring turbofish syntax.

§Example

// With EntityData implemented:
let token: PumpfunToken = hs.get_data("mint").await?;

// Without EntityData (original API still works):
let token = hs.get::<PumpfunTokenEntity>("mint").await;

The generated SDK code automatically implements this trait for each entity’s data type.

Required Associated Types§

Source

type Entity: Entity<Data = Self>

The Entity type that produces this Data type.

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.

Implementors§