Skip to main content

FlowType

Trait FlowType 

Source
pub trait FlowType: Data {
    // Provided methods
    fn decode_context(
        codec: &ContextCodec,
        value: &Json,
    ) -> Result<Self, DecodeError> { ... }
    fn encode_context(&self, codec: &ContextCodec) -> Result<Json, DecodeError> { ... }
    fn encode_field(&self) -> Option<Json> { ... }
    fn decode_field(value: Option<&Json>) -> Result<Self, DecodeError> { ... }
}
Expand description

A native boundary value with contextual conversion for generic calls. Native scalars, containers and #[derive(Flow)] supply implementations.

Provided Methods§

Source

fn decode_context( codec: &ContextCodec, value: &Json, ) -> Result<Self, DecodeError>

Reads a value using the compiler-validated concrete call type.

Source

fn encode_context(&self, codec: &ContextCodec) -> Result<Json, DecodeError>

Writes a value using the compiler-validated concrete call type.

Source

fn encode_field(&self) -> Option<Json>

Encodes a named field, including the special Option-field representation.

Source

fn decode_field(value: Option<&Json>) -> Result<Self, DecodeError>

Decodes a named field; Option aliases retain omission semantics.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FlowType for ()

Source§

impl FlowType for Infallible

Source§

impl FlowType for String

Source§

impl FlowType for bool

Source§

impl<A: FlowType, B: FlowType, C: FlowType, D: FlowType> FlowType for (A, B, C, D)

Source§

impl<A: FlowType, B: FlowType, C: FlowType> FlowType for (A, B, C)

Source§

impl<A: FlowType, B: FlowType> FlowType for (A, B)

Source§

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

Source§

impl<T: FlowType + Ord> FlowType for BTreeSet<T>

Source§

impl<T: FlowType, E: FlowType> FlowType for Result<T, E>

Source§

impl<T: FlowType> FlowType for Box<T>

Source§

impl<T: FlowType> FlowType for Option<T>

Source§

impl<T: FlowType> FlowType for Vec<T>

Implementors§