Crate wick_component
source ·Expand description
wick-component SDK
This crate provides the wick-component
SDK used to build components for the Wick runtime. It is the primary dependency used by the wick-component-codegen
generator and re-exports common dependencies for Wick components.
Re-exported dependencies
These are exposed at the root of the crate, i.e. wick_component::packet
or wick_component::wasmrs
.
wick-packet
aspacket
flow-component
wasmrs
wasmrs-guest
wasmrs-runtime
wasmrs-codec
wasmrs-rx
bytes
with featurebytes
chrono
with featuredatetime
- Partial export of
serde-json
- Partial export of
tokio-stream
See docs.rs for exact details.
Macros
propagate_if_error!
If the passed result is an error, the error propagates to all downstream outputs of a wick component and breaks execution with the provided statement. If the passed result is an Ok
, the unwrapped result is returned.
Re-exports
pub use flow_component;
pub use paste;
pub use wasmrs;
pub use wasmrs_codec;
pub use wasmrs_runtime as runtime;
pub use wasmrs_rx;
pub use wick_packet;
pub use anyhow;
Modules
- Functions and macros for common operation types. Utility functions for binary operations (operations with two inputs).
- Functions and macros for common operation types. Generic utility functions.
- Macros used by wick components and generated code.
- A module implementing custom serializers/deserializers for wick types.
- Functions and macros for common operation types. Utility functions for unary operations (operations with one input).
Macros
- This macro will generate the implementations for simple binary operations, operations that take two inputs, produce one output, and are largely want to remain ignorant of stream state.
- This macro will generate the implementations for binary operations that pair single packets with potential streams of packets.
- This macro will generate the implementations for operations, passing through packets without processing.
- Re-export of serde_json utilities; Construct a
serde_json::Value
from a JSON literal. - Unwrap a Result value to its Result::Ok value or propagate the error to the downstream inputs and short circuit the logic.
- This macro will generate the implementations for simple binary operations, operations that take two inputs, produce one output, and are largely want to remain ignorant of stream state.
- This macro will generate the implementations for simple unary operations, operations that take one input and can produce any number of outputs.
- This macro is used to include the generated code from a
wick-component-codegen
build step.
Structs
- Re-export of wick_packet::Base64Bytes as Bytes.
- Re-export of wasmrs_rx traits and core types. An implementation of the
Flux
as seen in RSocket and reactive streams. It is similar to a [Stream<Item = Result<Item, Err>>] or an unbounded channel. - Re-export of serde_json utilities; Represents a JSON key/value type.
- Re-export of wick_packet::Base64Bytes as Bytes.
- Re-export of wick_packet::Base64Bytes as Bytes.
Enums
- Re-export of serde_json utilities; Represents any valid JSON value.
Traits
- Trait for operation outputs to handle situations where packets need to be sent to all output streams.
- Re-export of wasmrs_rx traits and core types. A generic trait to wrap over Flux, Mono, and supporting types.
- Re-export of wasmrs_rx traits and core types. The wasmrs-rx implementation of an Rx Observable trait
- Re-export of wasmrs_rx traits and core types. The wasmrs-rx implementation of an Rx Observer trait
- Re-export of wick_packet::Base64Bytes as Bytes.
- Re-export of wick_packet::Base64Bytes as Bytes.
- Trait implemented for output sets with a single output port.
- Re-export of tokio_stream utilities; A stream of values produced asynchronously.
- Re-export of tokio_stream utilities; An extension trait for the
Stream
trait that provides a variety of convenient combinator functions. - Re-export of wick_packet::Base64Bytes as Bytes.
Functions
- Re-export of tokio_stream utilities; Creates a stream that yields nothing.
- Functions and macros for common operation types. Encode a Result type into a raw PacketPayload
- Re-export of serde_json utilities; Deserialize an instance of type
T
from bytes of JSON text. - Re-export of serde_json utilities; Deserialize an instance of type
T
from a string of JSON text. - Re-export of serde_json utilities; Interpret a
serde_json::Value
as an instance of typeT
. - Create a stream of
Result<T, AnyError>
from an iterator of type T. - Re-export of tokio_stream utilities; Converts an
Iterator
into aStream
which is always ready to yield the next value. - Create a stream of
Result<T, AnyError>
that yields one value and ends. - Re-export of tokio_stream utilities; Creates a stream that emits an element exactly once.
- Re-export of serde_json utilities; Convert a
T
intoserde_json::Value
which is an enum that can represent any valid JSON data.
Type Aliases
- A re-export of the
anyhow::Error
type. - Generic boxed-error type.
- Re-export of wick_packet::Base64Bytes as Bytes.
- A stream of
Result<T, AnyError>
.
Attribute Macros
- The proc macro to automatically implement common operaton types.