pub(crate) struct Build {
pub(crate) root_type_name: Ident,
pub(crate) gen_accessors: Ident,
pub(crate) accessor_type: Path,
pub(crate) output: TokenStream,
pub(crate) path_stack: Vec<Ident>,
pub(crate) path_map: HashMap<String, Vec<Ident>>,
}
Fields§
§root_type_name: Ident
§gen_accessors: Ident
§accessor_type: Path
§output: TokenStream
§path_stack: Vec<Ident>
§path_map: HashMap<String, Vec<Ident>>
Implementations§
source§impl Build
impl Build
pub(crate) fn new(input: &MacroInput) -> Self
pub(crate) fn build(self, type_def: &RootTypeDef) -> Result<TokenStream>
pub(crate) fn walk(&mut self, type_def: &NewTypeDef) -> Result<()>
pub(crate) fn define_pref_struct(&mut self, type_def: &NewTypeDef) -> Result<()>
pub(crate) fn build_accessors(&mut self)
pub(crate) fn pref_name(&self, field: &Field, path_stack: &[Ident]) -> String
pub(crate) fn field_to_tokens( &self, field: &Field, path_stack: &[Ident], ) -> Result<TokenStream>
pub(crate) fn path_to_name<'p, P: Iterator<Item = &'p Ident> + 'p>( &self, path: P, ) -> Ident
Auto Trait Implementations§
impl Freeze for Build
impl RefUnwindSafe for Build
impl !Send for Build
impl !Sync for Build
impl Unpin for Build
impl UnwindSafe for Build
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> 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>
Converts
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>
Converts
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