wick-component 0.17.0

Macros and exports used to create Wick components
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// Utility functions for binary operations (operations with two inputs).
pub mod binary;

/// Generic utility functions.
pub mod generic;
/// Utility functions for unary operations (operations with one input).
pub mod unary;

use wick_packet::PacketPayload;

/// Encode a [Result] type into a raw [PacketPayload]
pub fn encode<T: serde::Serialize, E: std::fmt::Display>(val: Result<T, E>) -> PacketPayload {
  match val {
    Ok(v) => PacketPayload::encode(v),
    Err(e) => PacketPayload::err(e.to_string()),
  }
}