#[repr(u32)]pub enum Prop {
Shorthand(Ident),
KeyValue(KeyValueProp),
Assign(AssignProp),
Getter(GetterProp),
Setter(SetterProp),
Method(MethodProp),
}
Variants§
Shorthand(Ident)
a
in { a, }
KeyValue(KeyValueProp)
key: value
in { key: value, }
Assign(AssignProp)
This is invalid for object literal.
Getter(GetterProp)
Setter(SetterProp)
Method(MethodProp)
Implementations§
Source§impl Prop
impl Prop
Sourcepub const fn is_shorthand(&self) -> bool
pub const fn is_shorthand(&self) -> bool
Returns true
if self
is of variant Shorthand
.
Sourcepub fn as_shorthand(&self) -> Option<&Ident>
pub fn as_shorthand(&self) -> Option<&Ident>
Returns Some
if self
is a reference of variant Shorthand
, and None
otherwise.
Sourcepub fn as_mut_shorthand(&mut self) -> Option<&mut Ident>
pub fn as_mut_shorthand(&mut self) -> Option<&mut Ident>
Returns Some
if self
is a mutable reference of variant Shorthand
, and None
otherwise.
Sourcepub fn expect_shorthand(self) -> Identwhere
Self: Debug,
pub fn expect_shorthand(self) -> Identwhere
Self: Debug,
Sourcepub fn shorthand(self) -> Option<Ident>
pub fn shorthand(self) -> Option<Ident>
Returns Some
if self
is of variant Shorthand
, and None
otherwise.
Sourcepub const fn is_key_value(&self) -> bool
pub const fn is_key_value(&self) -> bool
Returns true
if self
is of variant KeyValue
.
Sourcepub fn as_key_value(&self) -> Option<&KeyValueProp>
pub fn as_key_value(&self) -> Option<&KeyValueProp>
Returns Some
if self
is a reference of variant KeyValue
, and None
otherwise.
Sourcepub fn as_mut_key_value(&mut self) -> Option<&mut KeyValueProp>
pub fn as_mut_key_value(&mut self) -> Option<&mut KeyValueProp>
Returns Some
if self
is a mutable reference of variant KeyValue
, and None
otherwise.
Sourcepub fn expect_key_value(self) -> KeyValuePropwhere
Self: Debug,
pub fn expect_key_value(self) -> KeyValuePropwhere
Self: Debug,
Sourcepub fn key_value(self) -> Option<KeyValueProp>
pub fn key_value(self) -> Option<KeyValueProp>
Returns Some
if self
is of variant KeyValue
, and None
otherwise.
Sourcepub fn as_assign(&self) -> Option<&AssignProp>
pub fn as_assign(&self) -> Option<&AssignProp>
Returns Some
if self
is a reference of variant Assign
, and None
otherwise.
Sourcepub fn as_mut_assign(&mut self) -> Option<&mut AssignProp>
pub fn as_mut_assign(&mut self) -> Option<&mut AssignProp>
Returns Some
if self
is a mutable reference of variant Assign
, and None
otherwise.
Sourcepub fn expect_assign(self) -> AssignPropwhere
Self: Debug,
pub fn expect_assign(self) -> AssignPropwhere
Self: Debug,
Sourcepub fn assign(self) -> Option<AssignProp>
pub fn assign(self) -> Option<AssignProp>
Returns Some
if self
is of variant Assign
, and None
otherwise.
Sourcepub fn as_getter(&self) -> Option<&GetterProp>
pub fn as_getter(&self) -> Option<&GetterProp>
Returns Some
if self
is a reference of variant Getter
, and None
otherwise.
Sourcepub fn as_mut_getter(&mut self) -> Option<&mut GetterProp>
pub fn as_mut_getter(&mut self) -> Option<&mut GetterProp>
Returns Some
if self
is a mutable reference of variant Getter
, and None
otherwise.
Sourcepub fn expect_getter(self) -> GetterPropwhere
Self: Debug,
pub fn expect_getter(self) -> GetterPropwhere
Self: Debug,
Sourcepub fn getter(self) -> Option<GetterProp>
pub fn getter(self) -> Option<GetterProp>
Returns Some
if self
is of variant Getter
, and None
otherwise.
Sourcepub fn as_setter(&self) -> Option<&SetterProp>
pub fn as_setter(&self) -> Option<&SetterProp>
Returns Some
if self
is a reference of variant Setter
, and None
otherwise.
Sourcepub fn as_mut_setter(&mut self) -> Option<&mut SetterProp>
pub fn as_mut_setter(&mut self) -> Option<&mut SetterProp>
Returns Some
if self
is a mutable reference of variant Setter
, and None
otherwise.
Sourcepub fn expect_setter(self) -> SetterPropwhere
Self: Debug,
pub fn expect_setter(self) -> SetterPropwhere
Self: Debug,
Sourcepub fn setter(self) -> Option<SetterProp>
pub fn setter(self) -> Option<SetterProp>
Returns Some
if self
is of variant Setter
, and None
otherwise.
Sourcepub fn as_method(&self) -> Option<&MethodProp>
pub fn as_method(&self) -> Option<&MethodProp>
Returns Some
if self
is a reference of variant Method
, and None
otherwise.
Sourcepub fn as_mut_method(&mut self) -> Option<&mut MethodProp>
pub fn as_mut_method(&mut self) -> Option<&mut MethodProp>
Returns Some
if self
is a mutable reference of variant Method
, and None
otherwise.
Sourcepub fn expect_method(self) -> MethodPropwhere
Self: Debug,
pub fn expect_method(self) -> MethodPropwhere
Self: Debug,
Sourcepub fn method(self) -> Option<MethodProp>
pub fn method(self) -> Option<MethodProp>
Returns Some
if self
is of variant Method
, and None
otherwise.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for Prop
impl<'arbitrary> Arbitrary<'arbitrary> for Prop
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. Read moreSource§impl Archive for Prop
impl Archive for Prop
Source§type Resolver = PropResolver
type Resolver = PropResolver
Source§fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize
. Read moreSource§impl<'de> Deserialize<'de> for Prop
impl<'de> Deserialize<'de> for Prop
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>,
Source§impl EqIgnoreSpan for Prop
impl EqIgnoreSpan for Prop
fn eq_ignore_span(&self, other: &Self) -> bool
Source§impl From<AssignProp> for Prop
impl From<AssignProp> for Prop
Source§fn from(v: AssignProp) -> Self
fn from(v: AssignProp) -> Self
Source§impl From<GetterProp> for Prop
impl From<GetterProp> for Prop
Source§fn from(v: GetterProp) -> Self
fn from(v: GetterProp) -> Self
Source§impl From<KeyValueProp> for Prop
impl From<KeyValueProp> for Prop
Source§fn from(v: KeyValueProp) -> Self
fn from(v: KeyValueProp) -> Self
Source§impl From<MethodProp> for Prop
impl From<MethodProp> for Prop
Source§fn from(v: MethodProp) -> Self
fn from(v: MethodProp) -> Self
Source§impl From<Prop> for PropOrSpread
impl From<Prop> for PropOrSpread
Source§fn from(src: Prop) -> PropOrSpread
fn from(src: Prop) -> PropOrSpread
Source§impl From<SetterProp> for Prop
impl From<SetterProp> for Prop
Source§fn from(v: SetterProp) -> Self
fn from(v: SetterProp) -> Self
impl Eq for Prop
impl StructuralPartialEq for Prop
Auto Trait Implementations§
impl Freeze for Prop
impl RefUnwindSafe for Prop
impl Send for Prop
impl Sync for Prop
impl Unpin for Prop
impl UnwindSafe for Prop
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.