pub struct ForeignDerives {
pub debug: bool,
pub clone: bool,
pub partial_eq: bool,
}Expand description
Which of the three non-serde traits every generated model derives a foreign type satisfies.
The generator derives Debug, Clone, and PartialEq on every model. A
model that holds a type the generator did not write cannot derive a trait that
type lacks. The generator also cannot inspect the type, because the
specification names it as text and rustc resolves it much later. So the
specification author declares it, with x-rust-derive.
Self::default claims all three. That keeps the output of every
specification written before this feature identical, and it is right far more
often than not. uuid::Uuid, the chrono types, and a typical hand-written
domain type all derive the three. A target that does not is the case worth one
line of specification.
Fields§
§debug: boolThe target implements std::fmt::Debug.
clone: boolThe target implements Clone.
partial_eq: boolThe target implements PartialEq.
Trait Implementations§
Source§impl Clone for ForeignDerives
impl Clone for ForeignDerives
Source§fn clone(&self) -> ForeignDerives
fn clone(&self) -> ForeignDerives
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ForeignDerives
Source§impl Debug for ForeignDerives
impl Debug for ForeignDerives
Source§impl Default for ForeignDerives
impl Default for ForeignDerives
impl Eq for ForeignDerives
Source§impl PartialEq for ForeignDerives
impl PartialEq for ForeignDerives
impl StructuralPartialEq for ForeignDerives
Auto Trait Implementations§
impl Freeze for ForeignDerives
impl RefUnwindSafe for ForeignDerives
impl Send for ForeignDerives
impl Sync for ForeignDerives
impl Unpin for ForeignDerives
impl UnsafeUnpin for ForeignDerives
impl UnwindSafe for ForeignDerives
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.