pub enum PayloadSort {
Unit,
Nat,
Bool,
String,
Prod(Box<PayloadSort>, Box<PayloadSort>),
}Expand description
Payload sort types for message payloads.
Corresponds to Lean’s PayloadSort inductive type.
These represent the data types that can be sent in messages.
§Examples
use rumpsteak_types::PayloadSort;
let unit = PayloadSort::Unit;
assert!(unit.is_simple());
let pair = PayloadSort::prod(PayloadSort::Nat, PayloadSort::Bool);
assert!(!pair.is_simple());Variants§
Unit
Unit type (no payload)
Nat
Natural numbers
Bool
Booleans
String
Strings
Prod(Box<PayloadSort>, Box<PayloadSort>)
Product types (pairs)
Implementations§
Source§impl PayloadSort
impl PayloadSort
Sourcepub fn prod(left: PayloadSort, right: PayloadSort) -> PayloadSort
pub fn prod(left: PayloadSort, right: PayloadSort) -> PayloadSort
Create a product sort
Trait Implementations§
Source§impl Clone for PayloadSort
impl Clone for PayloadSort
Source§fn clone(&self) -> PayloadSort
fn clone(&self) -> PayloadSort
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Contentable for PayloadSort
impl Contentable for PayloadSort
Source§fn to_bytes(&self) -> Result<Vec<u8>, ContentableError>
fn to_bytes(&self) -> Result<Vec<u8>, ContentableError>
Serialize to canonical byte representation (JSON format).
Source§fn from_bytes(bytes: &[u8]) -> Result<PayloadSort, ContentableError>
fn from_bytes(bytes: &[u8]) -> Result<PayloadSort, ContentableError>
Deserialize from JSON bytes. Read more
Source§fn content_id<H>(&self) -> Result<ContentId<H>, ContentableError>where
H: Hasher,
fn content_id<H>(&self) -> Result<ContentId<H>, ContentableError>where
H: Hasher,
Compute content ID using the specified hasher (from JSON bytes).
Source§fn content_id_sha256(&self) -> Result<ContentId, ContentableError>
fn content_id_sha256(&self) -> Result<ContentId, ContentableError>
Compute content ID using default SHA-256 hasher (from JSON bytes).
Source§impl Debug for PayloadSort
impl Debug for PayloadSort
Source§impl Default for PayloadSort
impl Default for PayloadSort
Source§fn default() -> PayloadSort
fn default() -> PayloadSort
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PayloadSort
impl<'de> Deserialize<'de> for PayloadSort
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PayloadSort, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PayloadSort, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PayloadSort
impl Display for PayloadSort
Source§impl Hash for PayloadSort
impl Hash for PayloadSort
Source§impl PartialEq for PayloadSort
impl PartialEq for PayloadSort
Source§impl Serialize for PayloadSort
impl Serialize for PayloadSort
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for PayloadSort
impl StructuralPartialEq for PayloadSort
Auto Trait Implementations§
impl Freeze for PayloadSort
impl RefUnwindSafe for PayloadSort
impl Send for PayloadSort
impl Sync for PayloadSort
impl Unpin for PayloadSort
impl UnwindSafe for PayloadSort
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more