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 as packet
  • flow-component
  • wasmrs
  • wasmrs-guest
  • wasmrs-runtime
  • wasmrs-codec
  • wasmrs-rx
  • bytes with feature bytes
  • chrono with feature datetime
  • 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.
FluxChannel
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
PacketExt
Re-export of wick_packet::Base64Bytes as Bytes.
Port
Re-export of wick_packet::Base64Bytes as Bytes.
SingleOutput
Trait implemented for output sets with a single output port.
Stream
Re-export of tokio_stream utilities; A stream of values produced asynchronously.
StreamExt
Re-export of tokio_stream utilities; An extension trait for the Stream trait that provides a variety of convenient combinator functions.
ValuePort
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 type T.
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 a Stream 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 into serde_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.
PacketSender
Re-export of wick_packet::Base64Bytes as Bytes.
WickStream
A stream of Result<T, AnyError>.

Attribute Macros§

operation
The proc macro to automatically implement common operaton types.