Skip to main content

CrossLanguageSafe

Trait CrossLanguageSafe 

Source
pub trait CrossLanguageSafe: Serialize + DeserializeOwned { }
Expand description

Marker trait for types that can safely cross language boundaries.

Types implementing this trait must serialize to/from JSON using only universally supported primitives: bool, number, string, array, object, null. This excludes language-specific types (Python objects, Rust enums with data, etc.).

Used as a bound on ForeignTask params and results to provide compile-time enforcement that cross-language calls use compatible types.

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 CrossLanguageSafe for bool

Source§

impl CrossLanguageSafe for f32

Source§

impl CrossLanguageSafe for f64

Source§

impl CrossLanguageSafe for i32

Source§

impl CrossLanguageSafe for i64

Source§

impl CrossLanguageSafe for u32

Source§

impl CrossLanguageSafe for u64

Source§

impl CrossLanguageSafe for String

Source§

impl<K: CrossLanguageSafe + Eq + Hash, V: CrossLanguageSafe> CrossLanguageSafe for HashMap<K, V>

Source§

impl<K: CrossLanguageSafe + Ord, V: CrossLanguageSafe> CrossLanguageSafe for BTreeMap<K, V>

Source§

impl<T: CrossLanguageSafe> CrossLanguageSafe for Option<T>

Source§

impl<T: CrossLanguageSafe> CrossLanguageSafe for Vec<T>

Implementors§