pub enum PropertyKind {
Value,
Method,
Get,
Set,
}Expand description
What an object-literal property does with its value.
Distinct from MethodKind on purpose: an object literal can never contain a
constructor, and the compiler needs to tell {a: 1} from {a() {}} — the two
compile to different instructions (define_field vs define_method), even though
both hold a value on the stack.
Variants§
Value
key: value or the {key} shorthand — stores a data property.
Method
m() {} — defines a method.
Get
get m() {} — the value is the getter.
Set
set m(v) {} — the value is the setter.
Trait Implementations§
Source§impl Clone for PropertyKind
impl Clone for PropertyKind
impl Copy for PropertyKind
Source§impl Debug for PropertyKind
impl Debug for PropertyKind
impl Eq for PropertyKind
Source§impl PartialEq for PropertyKind
impl PartialEq for PropertyKind
impl StructuralPartialEq for PropertyKind
Auto Trait Implementations§
impl Forget for PropertyKind
impl Freeze for PropertyKind
impl Move for PropertyKind
impl RefUnwindSafe for PropertyKind
impl Send for PropertyKind
impl Sync for PropertyKind
impl Unpin for PropertyKind
impl UnsafeUnpin for PropertyKind
impl UnwindSafe for PropertyKind
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