#[allow(unused_imports)]
use crate::{
cbor::{Decoder, Encoder, Write},
error::{RpcError, RpcResult},
};
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[allow(dead_code)]
pub const SMITHY_VERSION: &str = "1.0";
pub type CapabilityContractId = String;
#[doc(hidden)]
#[allow(unused_mut)]
pub fn encode_capability_contract_id<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &CapabilityContractId,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.str(val)?;
Ok(())
}
#[doc(hidden)]
pub fn decode_capability_contract_id(
d: &mut crate::cbor::Decoder<'_>,
) -> Result<CapabilityContractId, RpcError> {
let __result = { d.str()?.to_string() };
Ok(__result)
}
pub type F32 = f32;
#[doc(hidden)]
#[allow(unused_mut)]
#[inline]
pub fn encode_f32<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &F32,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.f32(*val)?;
Ok(())
}
#[doc(hidden)]
#[inline]
pub fn decode_f32(d: &mut crate::cbor::Decoder<'_>) -> Result<F32, RpcError> {
let __result = { d.f32()? };
Ok(__result)
}
pub type F64 = f64;
#[doc(hidden)]
#[allow(unused_mut)]
#[inline]
pub fn encode_f64<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &F64,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.f64(*val)?;
Ok(())
}
#[doc(hidden)]
#[inline]
pub fn decode_f64(d: &mut crate::cbor::Decoder<'_>) -> Result<F64, RpcError> {
let __result = { d.f64()? };
Ok(__result)
}
pub type I16 = i16;
#[doc(hidden)]
#[allow(unused_mut)]
#[inline]
pub fn encode_i16<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &I16,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.i16(*val)?;
Ok(())
}
#[doc(hidden)]
#[inline]
pub fn decode_i16(d: &mut crate::cbor::Decoder<'_>) -> Result<I16, RpcError> {
let __result = { d.i16()? };
Ok(__result)
}
pub type I32 = i32;
#[doc(hidden)]
#[allow(unused_mut)]
#[inline]
pub fn encode_i32<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &I32,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.i32(*val)?;
Ok(())
}
#[doc(hidden)]
#[inline]
pub fn decode_i32(d: &mut crate::cbor::Decoder<'_>) -> Result<I32, RpcError> {
let __result = { d.i32()? };
Ok(__result)
}
pub type I64 = i64;
#[doc(hidden)]
#[allow(unused_mut)]
#[inline]
pub fn encode_i64<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &I64,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.i64(*val)?;
Ok(())
}
#[doc(hidden)]
#[inline]
pub fn decode_i64(d: &mut crate::cbor::Decoder<'_>) -> Result<I64, RpcError> {
let __result = { d.i64()? };
Ok(__result)
}
pub type I8 = i8;
#[doc(hidden)]
#[allow(unused_mut)]
#[inline]
pub fn encode_i8<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &I8,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.i8(*val)?;
Ok(())
}
#[doc(hidden)]
#[inline]
pub fn decode_i8(d: &mut crate::cbor::Decoder<'_>) -> Result<I8, RpcError> {
let __result = { d.i8()? };
Ok(__result)
}
pub type IdentifierList = Vec<String>;
#[doc(hidden)]
#[allow(unused_mut)]
pub fn encode_identifier_list<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &IdentifierList,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.array(val.len() as u64)?;
for item in val.iter() {
e.str(item)?;
}
Ok(())
}
#[doc(hidden)]
pub fn decode_identifier_list(
d: &mut crate::cbor::Decoder<'_>,
) -> Result<IdentifierList, RpcError> {
let __result = {
if let Some(n) = d.array()? {
let mut arr: Vec<String> = Vec::with_capacity(n as usize);
for _ in 0..(n as usize) {
arr.push(d.str()?.to_string())
}
arr
} else {
let mut arr: Vec<String> = Vec::new();
loop {
match d.datatype() {
Err(_) => break,
Ok(crate::cbor::Type::Break) => break,
Ok(_) => arr.push(d.str()?.to_string()),
}
}
arr
}
};
Ok(__result)
}
pub type U16 = i16;
#[doc(hidden)]
#[allow(unused_mut)]
#[inline]
pub fn encode_u16<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &U16,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.i16(*val)?;
Ok(())
}
#[doc(hidden)]
#[inline]
pub fn decode_u16(d: &mut crate::cbor::Decoder<'_>) -> Result<U16, RpcError> {
let __result = { d.i16()? };
Ok(__result)
}
pub type U32 = i32;
#[doc(hidden)]
#[allow(unused_mut)]
#[inline]
pub fn encode_u32<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &U32,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.i32(*val)?;
Ok(())
}
#[doc(hidden)]
#[inline]
pub fn decode_u32(d: &mut crate::cbor::Decoder<'_>) -> Result<U32, RpcError> {
let __result = { d.i32()? };
Ok(__result)
}
pub type U64 = i64;
#[doc(hidden)]
#[allow(unused_mut)]
#[inline]
pub fn encode_u64<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &U64,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.i64(*val)?;
Ok(())
}
#[doc(hidden)]
#[inline]
pub fn decode_u64(d: &mut crate::cbor::Decoder<'_>) -> Result<U64, RpcError> {
let __result = { d.i64()? };
Ok(__result)
}
pub type U8 = i8;
#[doc(hidden)]
#[allow(unused_mut)]
#[inline]
pub fn encode_u8<W: crate::cbor::Write>(
mut e: &mut crate::cbor::Encoder<W>,
val: &U8,
) -> RpcResult<()>
where
<W as crate::cbor::Write>::Error: std::fmt::Display,
{
e.i8(*val)?;
Ok(())
}
#[doc(hidden)]
#[inline]
pub fn decode_u8(d: &mut crate::cbor::Decoder<'_>) -> Result<U8, RpcError> {
let __result = { d.i8()? };
Ok(__result)
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct CodegenRust {
#[serde(rename = "noDeriveDefault")]
#[serde(default)]
pub no_derive_default: bool,
#[serde(rename = "noDeriveEq")]
#[serde(default)]
pub no_derive_eq: bool,
#[serde(rename = "nonExhaustive")]
#[serde(default)]
pub non_exhaustive: bool,
#[serde(default)]
pub skip: bool,
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Extends {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base: Option<IdentifierList>,
}
pub type N = i16;
pub type NonEmptyString = String;
pub type Rename = Vec<RenameItem>;
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct RenameItem {
#[serde(default)]
pub lang: String,
#[serde(default)]
pub name: String,
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Serialization {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Synonym {}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct UnsignedInt {}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Wasmbus {
#[serde(rename = "actorReceive")]
#[serde(default)]
pub actor_receive: bool,
#[serde(rename = "contractId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub contract_id: Option<CapabilityContractId>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
#[serde(rename = "providerReceive")]
#[serde(default)]
pub provider_receive: bool,
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct WasmbusData {}