Struct edres::StructOptions
source · [−]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
sourceimpl 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
sourceimpl Clone for StructOptions
impl Clone for StructOptions
sourcefn clone(&self) -> StructOptions
fn clone(&self) -> StructOptions
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for StructOptions
impl Debug for StructOptions
sourceimpl Default for StructOptions
impl Default for StructOptions
sourcefn default() -> StructOptions
fn default() -> StructOptions
Examples
assert_eq!(StructOptions::default(), StructOptions::new());
sourceimpl PartialEq<StructOptions> for StructOptions
impl PartialEq<StructOptions> for StructOptions
sourcefn eq(&self, other: &StructOptions) -> bool
fn eq(&self, other: &StructOptions) -> bool
impl Eq for StructOptions
impl StructuralEq for StructOptions
impl StructuralPartialEq for StructOptions
Auto Trait Implementations
impl RefUnwindSafe for StructOptions
impl Send for StructOptions
impl Sync for StructOptions
impl Unpin for StructOptions
impl UnwindSafe for StructOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.