pub enum StructKind {
Unit,
Tuple(Vec<Option<Id>>),
Plain {
fields: Vec<Id>,
has_stripped_fields: bool,
},
}
Expand description
The kind of a Struct
and the data specific to it, i.e. fields.
Variants§
Unit
A struct with no fields and no parentheses.
pub struct Unit;
Tuple(Vec<Option<Id>>)
A struct with unnamed fields.
All Id
’s will point to ItemEnum::StructField
.
Unlike most of JSON, private and #[doc(hidden)]
fields will be given as None
instead of being omitted, because order matters.
pub struct TupleStruct(i32);
pub struct EmptyTupleStruct();
Plain
A struct with named fields.
pub struct PlainStruct { x: i32 }
pub struct EmptyPlainStruct {}
Trait Implementations§
Source§impl Clone for StructKind
impl Clone for StructKind
Source§fn clone(&self) -> StructKind
fn clone(&self) -> StructKind
Returns a copy of the value. Read more
1.0.0 · 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 StructKind
impl Debug for StructKind
Source§impl<'de> Deserialize<'de> for StructKind
impl<'de> Deserialize<'de> for StructKind
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
Source§impl Hash for StructKind
impl Hash for StructKind
Source§impl PartialEq for StructKind
impl PartialEq for StructKind
Source§impl Serialize for StructKind
impl Serialize for StructKind
impl Eq for StructKind
impl StructuralPartialEq for StructKind
Auto Trait Implementations§
impl Freeze for StructKind
impl RefUnwindSafe for StructKind
impl Send for StructKind
impl Sync for StructKind
impl Unpin for StructKind
impl UnwindSafe for StructKind
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>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes
Size for each variant:
Unit
: 0 bytesTuple
: 32 bytesPlain
: 32 bytes