pub enum RequireFields {
All(bool),
Named(Vec<String>),
}Expand description
require_fields of a [[contract]]: which fields of the contract type a module’s
returned table has to carry.
require_fields = true # every declared field
require_fields = ["name", "monsters", "items"] # these, so the type can growThe list exists because every Teal record field is nilable and Teal has no ? for
record fields, so a type cannot say which of its own fields are mandatory. Without
it, adding a field to a contract type makes every module already written against it
fail, and the only way out is to stop checking.
Variants§
All(bool)
true: every field the type declares. false: no field check at all.
Named(Vec<String>)
Exactly these. A name the type does not declare is an error, not a no-op.
Implementations§
Trait Implementations§
Source§impl Clone for RequireFields
impl Clone for RequireFields
Source§fn clone(&self) -> RequireFields
fn clone(&self) -> RequireFields
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequireFields
impl Debug for RequireFields
Source§impl Default for RequireFields
impl Default for RequireFields
Source§impl<'de> Deserialize<'de> for RequireFields
impl<'de> Deserialize<'de> for RequireFields
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
impl Eq for RequireFields
Source§impl PartialEq for RequireFields
impl PartialEq for RequireFields
impl StructuralPartialEq for RequireFields
Auto Trait Implementations§
impl Freeze for RequireFields
impl RefUnwindSafe for RequireFields
impl Send for RequireFields
impl Sync for RequireFields
impl Unpin for RequireFields
impl UnsafeUnpin for RequireFields
impl UnwindSafe for RequireFields
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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