pub struct StructOptions {
pub derived_traits: Cow<'static, [Cow<'static, str>]>,
pub struct_data_const_name: Option<Cow<'static, str>>,
}Expand description
Options specific to how edres should generate structs.
Fields§
§derived_traits: Cow<'static, [Cow<'static, str>]>A list of traits to derive.
These can either be unqualified (like Clone) or
qualifier with a crate name (like serde::Serialize).
See the StructOptions::new example to see how to easily
set this value.
struct_data_const_name: Option<Cow<'static, str>>If present, generates a const with the given name that stores the contents of the file as a value of the generated type.
Implementations§
Source§impl StructOptions
impl StructOptions
Sourcepub const fn new() -> StructOptions
pub const fn new() -> StructOptions
§Examples
assert_eq!(StructOptions::new(), StructOptions {
derived_traits: vec!["Debug".into()].into(),
struct_data_const_name: Some("DATA".into()),
});Sourcepub const fn minimal() -> StructOptions
pub const fn minimal() -> StructOptions
§Examples
assert_eq!(StructOptions::minimal(), StructOptions {
derived_traits: vec![].into(),
struct_data_const_name: None,
});Trait Implementations§
Source§impl Clone for StructOptions
impl Clone for StructOptions
Source§fn clone(&self) -> StructOptions
fn clone(&self) -> StructOptions
Returns a duplicate 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 StructOptions
impl Debug for StructOptions
Source§impl Default for StructOptions
impl Default for StructOptions
Source§fn default() -> StructOptions
fn default() -> StructOptions
§Examples
assert_eq!(StructOptions::default(), StructOptions::new());Source§impl PartialEq for StructOptions
impl PartialEq for StructOptions
impl Eq for StructOptions
impl StructuralPartialEq for StructOptions
Auto Trait Implementations§
impl Freeze for StructOptions
impl RefUnwindSafe for StructOptions
impl Send for StructOptions
impl Sync for StructOptions
impl Unpin for StructOptions
impl UnwindSafe for StructOptions
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§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
Compare self to
key and return true if they are equal.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
Compare self to
key and return true if they are equal.