DamlType

Enum DamlType 

Source
pub enum DamlType<'a> {
Show 28 variants ContractId(Option<Box<DamlType<'a>>>), Int64, Numeric(Vec<DamlType<'a>>), Text, Timestamp, Party, Bool, Unit, Date, List(Vec<DamlType<'a>>), TextMap(Vec<DamlType<'a>>), GenMap(Vec<DamlType<'a>>), Optional(Vec<DamlType<'a>>), TyCon(DamlTyCon<'a>), BoxedTyCon(DamlTyCon<'a>), Var(DamlVar<'a>), Nat(u8), Arrow, Any, TypeRep, Bignumeric, RoundingMode, AnyException, Update, Scenario, Forall(DamlForall<'a>), Struct(DamlStruct<'a>), Syn(DamlSyn<'a>),
}
Expand description

A Daml type.

Variants§

§

ContractId(Option<Box<DamlType<'a>>>)

Opaque contract identifier.

§

Int64

Signed 64 bit integer.

§

Numeric(Vec<DamlType<'a>>)

Fixed precision numeric.

§

Text

Unicode text data.

§

Timestamp

A date & time.

§

Party

A Daml Party.

§

Bool

A Boolean type.

§

Unit

A Unit type.

§

Date

A date.

§

List(Vec<DamlType<'a>>)

A list.

§

TextMap(Vec<DamlType<'a>>)

A map wih DamlType::Text keys.

§

GenMap(Vec<DamlType<'a>>)

A map.

§

Optional(Vec<DamlType<'a>>)

An optional value.

§

TyCon(DamlTyCon<'a>)

A type constructor.

§

BoxedTyCon(DamlTyCon<'a>)

A type constructor (heap allocated).

§

Var(DamlVar<'a>)

A type variable.

§

Nat(u8)

A natural number.

§

Arrow

A function.

§

Any

Any type.

§

TypeRep

A type rep.

§

Bignumeric

A big numeric.

§

RoundingMode

A rounding mode.

§

AnyException

An exception.

§

Update

An update effect.

§

Scenario

A scenario effect.

§

Forall(DamlForall<'a>)

Universal qualifier.

§

Struct(DamlStruct<'a>)

A struct type.

§

Syn(DamlSyn<'a>)

A type synonym.

Implementations§

Source§

impl<'a> DamlType<'a>

Source

pub fn name(&self) -> &str

Source

pub fn contains_type_var(&self, type_var: &str) -> bool

Returns true if this DamlType contain a reference to type_var, false otherwise.

Source

pub fn make_tycon<'b, S: AsRef<str> + 'b>( package_id: &'b str, module: &'b [S], entity: &'b str, ) -> DamlType<'b>

Convenience method to create a DamlType::TyCon for a given package id, module path and entity.

Source

pub fn make_tycon_with_args<'b, S: AsRef<str> + 'b>( package_id: &'b str, module: &'b [S], entity: &'b str, type_arguments: Vec<DamlType<'b>>, ) -> DamlType<'b>

Convenience method to create a DamlType::TyCon for a given package id, module path, entity & type args.

Trait Implementations§

Source§

impl<'a> Clone for DamlType<'a>

Source§

fn clone(&self) -> DamlType<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> DamlVisitableElement<'a> for DamlType<'a>

Source§

fn accept(&'a self, visitor: &'a mut impl DamlElementVisitor)

Source§

impl<'a> Debug for DamlType<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> IntoBoundedStatic for DamlType<'a>

Source§

type Static = DamlType<'static>

The target type is bounded by the 'static lifetime.
Source§

fn into_static(self) -> Self::Static

Convert an owned T into an owned T such that T: 'static.
Source§

impl<'a> Serialize for DamlType<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a> ToBoundedStatic for DamlType<'a>

Source§

type Static = DamlType<'static>

The target type is bounded by the 'static lifetime.
Source§

fn to_static(&self) -> Self::Static

Convert an &T to an owned T such that T: 'static.

Auto Trait Implementations§

§

impl<'a> Freeze for DamlType<'a>

§

impl<'a> RefUnwindSafe for DamlType<'a>

§

impl<'a> Send for DamlType<'a>

§

impl<'a> Sync for DamlType<'a>

§

impl<'a> Unpin for DamlType<'a>

§

impl<'a> UnwindSafe for DamlType<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.