pub enum PayloadSort {
Unit,
Nat,
Bool,
String,
Real,
Vector(usize),
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 telltale_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
Real
Real numbers (floating point physical quantities)
Vector(usize)
Fixed-size vectors (e.g. configuration space, phase space)
Prod(Box<PayloadSort>, Box<PayloadSort>)
Product types (pairs)
Implementations§
Source§impl PayloadSort
impl PayloadSort
Sourcepub fn prod(left: PayloadSort, right: PayloadSort) -> Self
pub fn prod(left: PayloadSort, right: PayloadSort) -> Self
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). Read more
Source§fn from_bytes(bytes: &[u8]) -> Result<Self, ContentableError>
fn from_bytes(bytes: &[u8]) -> Result<Self, ContentableError>
Deserialize from JSON bytes. Read more
Source§fn to_template_bytes(&self) -> Result<Vec<u8>, ContentableError>
fn to_template_bytes(&self) -> Result<Vec<u8>, ContentableError>
Serialize to template bytes, allowing open terms with explicit
free-variable interfaces when supported by the implementation. Read more
Source§fn content_id<H: Hasher>(&self) -> Result<ContentId<H>, ContentableError>
fn content_id<H: Hasher>(&self) -> Result<ContentId<H>, ContentableError>
Compute content ID using the specified hasher (from JSON bytes). Read more
Source§fn content_id_default(
&self,
) -> Result<ContentId<DefaultContentHasher>, ContentableError>
fn content_id_default( &self, ) -> Result<ContentId<DefaultContentHasher>, ContentableError>
Compute content ID using the central default content hasher (from JSON bytes). Read more
Source§fn content_id_blake3(&self) -> Result<ContentId<Blake3Hasher>, ContentableError>
fn content_id_blake3(&self) -> Result<ContentId<Blake3Hasher>, ContentableError>
Compute content ID using explicit BLAKE3 (from JSON bytes). Read more
Source§fn template_id<H: Hasher>(&self) -> Result<ContentId<H>, ContentableError>
fn template_id<H: Hasher>(&self) -> Result<ContentId<H>, ContentableError>
Compute a template ID using the specified hasher (from template bytes). Read more
Source§fn template_id_default(
&self,
) -> Result<ContentId<DefaultContentHasher>, ContentableError>
fn template_id_default( &self, ) -> Result<ContentId<DefaultContentHasher>, ContentableError>
Compute a template ID using the central default content hasher. Read more
Source§fn template_id_blake3(
&self,
) -> Result<ContentId<Blake3Hasher>, ContentableError>
fn template_id_blake3( &self, ) -> Result<ContentId<Blake3Hasher>, ContentableError>
Compute a template ID using explicit BLAKE3. Read more
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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
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 UnsafeUnpin 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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Casts the value.
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.