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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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