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§
- binary
- Functions and macros for common operation types. Utility functions for binary operations (operations with two inputs).
- generic
- Functions and macros for common operation types. Generic utility functions.
- macros
- Macros used by wick components and generated code.
- serde_
util - A module implementing custom serializers/deserializers for wick types.
- unary
- Functions and macros for common operation types. Utility functions for unary operations (operations with one input).
Macros§
- await_
next_ ok_ or - binary_
interleaved_ pairs - 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.
- binary_
paired_ right_ stream - This macro will generate the implementations for binary operations that pair single packets with potential streams of packets.
- generic_
raw - This macro will generate the implementations for operations, passing through packets without processing.
- json
- Re-export of serde_json utilities;
Construct a
serde_json::Value
from a JSON literal. - make_
substream_ window - propagate_
if_ error - Unwrap a Result value to its Result::Ok value or propagate the error to the downstream inputs and short circuit the logic.
- unary_
simple - 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.
- unary_
with_ outputs - This macro will generate the implementations for simple unary operations, operations that take one input and can produce any number of outputs.
- wick_
import - This macro is used to include the generated code from a
wick-component-codegen
build step.
Structs§
- Bytes
- Re-export of wick_packet::Base64Bytes as Bytes.
- Flux
Channel - 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. - Map
- Re-export of serde_json utilities; Represents a JSON key/value type.
- Packet
- Re-export of wick_packet::Base64Bytes as Bytes.
- VPacket
- Re-export of wick_packet::Base64Bytes as Bytes.
Enums§
- Value
- Re-export of serde_json utilities; Represents any valid JSON value.
Traits§
- Broadcast
- Trait for operation outputs to handle situations where packets need to be sent to all output streams.
- Flux
- Re-export of wasmrs_rx traits and core types. A generic trait to wrap over Flux, Mono, and supporting types.
- Observable
- Re-export of wasmrs_rx traits and core types. The wasmrs-rx implementation of an Rx Observable trait
- Observer
- Re-export of wasmrs_rx traits and core types. The wasmrs-rx implementation of an Rx Observer trait
- Packet
Ext - Re-export of wick_packet::Base64Bytes as Bytes.
- Port
- Re-export of wick_packet::Base64Bytes as Bytes.
- Single
Output - Trait implemented for output sets with a single output port.
- Stream
- Re-export of tokio_stream utilities; A stream of values produced asynchronously.
- Stream
Ext - Re-export of tokio_stream utilities;
An extension trait for the
Stream
trait that provides a variety of convenient combinator functions. - Value
Port - Re-export of wick_packet::Base64Bytes as Bytes.
Functions§
- empty
- Re-export of tokio_stream utilities; Creates a stream that yields nothing.
- encode
- Functions and macros for common operation types. Encode a Result type into a raw PacketPayload
- from_
slice - Re-export of serde_json utilities;
Deserialize an instance of type
T
from bytes of JSON text. - from_
str - Re-export of serde_json utilities;
Deserialize an instance of type
T
from a string of JSON text. - from_
value - Re-export of serde_json utilities;
Interpret a
serde_json::Value
as an instance of typeT
. - iter
- Create a stream of
Result<T, AnyError>
from an iterator of type T. - iter_
raw - Re-export of tokio_stream utilities;
Converts an
Iterator
into aStream
which is always ready to yield the next value. - once
- Create a stream of
Result<T, AnyError>
that yields one value and ends. - once_
raw - Re-export of tokio_stream utilities; Creates a stream that emits an element exactly once.
- to_
value - 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§
- AnyError
- A re-export of the
anyhow::Error
type. - BoxError
- Generic boxed-error type.
- BoxStream
- Re-export of wick_packet::Base64Bytes as Bytes.
A Pin<Box
> of T
. - Packet
Sender - Re-export of wick_packet::Base64Bytes as Bytes.
- Wick
Stream - A stream of
Result<T, AnyError>
.
Attribute Macros§
- operation
- The proc macro to automatically implement common operaton types.