frost-core-sdk 0.1.0

Core types and shared utilities for the FROST WIT SDKs.
Documentation
// @generated by tools/specgen. DO NOT EDIT.
use core::fmt;

#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct PropKey(pub &'static str);
impl PropKey { pub const fn as_str(self) -> &'static str { self.0 } }
impl fmt::Display for PropKey { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.0) } }

#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct Domain(pub &'static str);
impl Domain { pub const fn as_str(self) -> &'static str { self.0 } }
impl fmt::Display for Domain { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.0) } }

#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct ErrorCode(pub &'static str);
impl ErrorCode { pub const fn as_str(self) -> &'static str { self.0 } }
impl fmt::Display for ErrorCode { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.0) } }

pub const PREFIX_FROST: &str = "frost.";
pub const PREFIX_VENDOR: &str = "vendor.";

pub mod keys {
  pub mod ctx {
    pub const IDEMPOTENCY_KEY: crate::generated::PropKey = crate::generated::PropKey("frost.idempotency.key");
    pub const REQUEST_ID: crate::generated::PropKey = crate::generated::PropKey("frost.request.id");
  }
  pub mod props {
    pub mod http {
      pub const RESPONSE_STATUS: crate::generated::PropKey = crate::generated::PropKey("http.response.status");
    }
  }

}

pub mod error {
  pub mod domains {
    pub mod core {
      pub const CONTEXT: crate::generated::Domain = crate::generated::Domain("frost.core.context");
      pub const IO: crate::generated::Domain = crate::generated::Domain("frost.core.io");
    }

  }
  pub mod codes {
    pub mod core_context {
      pub const CANCELLED: crate::generated::ErrorCode = crate::generated::ErrorCode("cancelled");
    }
    pub mod core_io {
      pub const EOF: crate::generated::ErrorCode = crate::generated::ErrorCode("eof");
    }

  }
}