mirror of
https://github.com/salsa-rs/salsa.git
synced 2024-10-23 12:49:57 +00:00
Add methods in SalsaField
and SalsaStruct
to get visibility of field
This commit is contained in:
parent
657b85682b
commit
3542f2a1e7
1 changed files with 10 additions and 0 deletions
|
@ -96,6 +96,11 @@ impl<A: AllowedOptions> SalsaStruct<A> {
|
|||
self.all_fields().map(|ef| ef.name()).collect()
|
||||
}
|
||||
|
||||
/// Visibilities of all fields
|
||||
pub(crate) fn all_field_vises(&self) -> Vec<&syn::Visibility> {
|
||||
self.all_fields().map(|ef| ef.vis()).collect()
|
||||
}
|
||||
|
||||
/// Names of getters of all fields
|
||||
pub(crate) fn all_get_field_names(&self) -> Vec<&syn::Ident> {
|
||||
self.all_fields().map(|ef| ef.get_name()).collect()
|
||||
|
@ -406,6 +411,11 @@ impl SalsaField {
|
|||
self.field.ident.as_ref().unwrap()
|
||||
}
|
||||
|
||||
/// The visibility of this field.
|
||||
pub(crate) fn vis(&self) -> &syn::Visibility {
|
||||
&self.field.vis
|
||||
}
|
||||
|
||||
/// The type of this field (all `SalsaField` instances are named).
|
||||
pub(crate) fn ty(&self) -> &syn::Type {
|
||||
&self.field.ty
|
||||
|
|
Loading…
Reference in a new issue