pub struct CodegenSettings {
pub optionable_crate_name: Path,
pub ty_prefix: Option<Path>,
pub input_crate_replacement: Option<Ident>,
}Expand description
Settings that are only available to be set via the rust function signature of derive_optionable
but not via the derive macro (as they are not useful in that context and would lead to an
increased but not useful API surface of the derive macro helpers).
Fields§
§optionable_crate_name: PathName of the optionable crate to use for the generated code including potentially
leading ::. Useful to set when generating code for the optionable
crate itself where one needs to refer to it as crate.
ty_prefix: Option<Path>Path prefix to prepend to the respective type. E.g. with a ty_prefix of ::mycrate
the output would be (simplified) impl Optionable for ::mycrate::mytype.
input_crate_replacement: Option<Ident>Replacement for the keyword crate in the input type/enum definition or references.
Useful when generating code for the optionable crate as pre-existing crate references
need to be replaced with the concret crate name.
Trait Implementations§
Source§impl Clone for CodegenSettings
impl Clone for CodegenSettings
Source§fn clone(&self) -> CodegenSettings
fn clone(&self) -> CodegenSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CodegenSettings
impl Debug for CodegenSettings
Source§impl Default for CodegenSettings
impl Default for CodegenSettings
Source§impl FromDeriveInput for CodegenSettings
impl FromDeriveInput for CodegenSettings
Source§fn from_derive_input(__di: &DeriveInput) -> Result<Self>
fn from_derive_input(__di: &DeriveInput) -> Result<Self>
syn::DeriveInput, or return an error.Auto Trait Implementations§
impl Freeze for CodegenSettings
impl RefUnwindSafe for CodegenSettings
impl !Send for CodegenSettings
impl !Sync for CodegenSettings
impl Unpin for CodegenSettings
impl UnwindSafe for CodegenSettings
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more