pub enum DictTypeFlavour {
Type,
Contract,
}Expand description
Flavour of a dictionary type. There are currently two way of writing a dictionary type-ish
object: as a dictionary contract {_ | T} or as a dictionary type {_ : T}. Ideally, the
former wouldn’t even be a type but mostly syntactic sugar for a builtin contract application,
or maybe a proper AST node.
However, the LSP needs to handle both dictionary types and contracts specifically in order to provide good completion. As we added dictionary contract just before 1.0 to fix a non trivial issue with respect to polymorphic contracts (GitHub issue), the solution to just tweak dictionary types to be able to hold both kinds - generating a different contract - seemed to be the simplest to preserve the user experience (LSP, handling of dictionary when reporting a contract blame, etc.).
Dictionary contracts might get a proper AST node later on.
Variants§
Trait Implementations§
Source§impl Clone for DictTypeFlavour
impl Clone for DictTypeFlavour
Source§fn clone(&self) -> DictTypeFlavour
fn clone(&self) -> DictTypeFlavour
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DictTypeFlavour
impl Debug for DictTypeFlavour
Source§impl PartialEq for DictTypeFlavour
impl PartialEq for DictTypeFlavour
impl Copy for DictTypeFlavour
impl Eq for DictTypeFlavour
impl StructuralPartialEq for DictTypeFlavour
Auto Trait Implementations§
impl Freeze for DictTypeFlavour
impl RefUnwindSafe for DictTypeFlavour
impl Send for DictTypeFlavour
impl Sync for DictTypeFlavour
impl Unpin for DictTypeFlavour
impl UnsafeUnpin for DictTypeFlavour
impl UnwindSafe for DictTypeFlavour
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
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>
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>
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