@@ -38,7 +38,7 @@ pub(crate) struct ItemNursery(Vec<NurseryItem>);
3838pub ( crate ) struct ValidatedItemNursery ( ItemNursery ) ;
3939
4040impl ItemNursery {
41- pub fn add_item (
41+ pub ( crate ) fn add_item (
4242 & mut self ,
4343 attr_name : Ident ,
4444 py_names : Vec < String > ,
@@ -56,7 +56,7 @@ impl ItemNursery {
5656 Ok ( ( ) )
5757 }
5858
59- pub fn validate ( self ) -> Result < ValidatedItemNursery > {
59+ pub ( crate ) fn validate ( self ) -> Result < ValidatedItemNursery > {
6060 let mut by_name: HashSet < ( String , Vec < Attribute > ) > = HashSet :: new ( ) ;
6161 for item in & self . 0 {
6262 for py_name in & item. py_names {
@@ -118,7 +118,7 @@ pub(crate) struct ItemMetaInner {
118118}
119119
120120impl ItemMetaInner {
121- pub fn from_nested < I > (
121+ pub ( crate ) fn from_nested < I > (
122122 item_ident : Ident ,
123123 meta_ident : Ident ,
124124 nested : I ,
@@ -154,15 +154,15 @@ impl ItemMetaInner {
154154 } )
155155 }
156156
157- pub fn item_name ( & self ) -> String {
157+ pub ( crate ) fn item_name ( & self ) -> String {
158158 self . item_ident . to_string ( )
159159 }
160160
161- pub fn meta_name ( & self ) -> String {
161+ pub ( crate ) fn meta_name ( & self ) -> String {
162162 self . meta_ident . to_string ( )
163163 }
164164
165- pub fn _optional_str ( & self , key : & str ) -> Result < Option < String > > {
165+ pub ( crate ) fn _optional_str ( & self , key : & str ) -> Result < Option < String > > {
166166 let value = if let Some ( ( _, meta) ) = self . meta_map . get ( key) {
167167 let Meta :: NameValue ( syn:: MetaNameValue {
168168 value :
@@ -187,7 +187,7 @@ impl ItemMetaInner {
187187 Ok ( value)
188188 }
189189
190- pub fn _optional_path ( & self , key : & str ) -> Result < Option < syn:: Path > > {
190+ pub ( crate ) fn _optional_path ( & self , key : & str ) -> Result < Option < syn:: Path > > {
191191 let value = if let Some ( ( _, meta) ) = self . meta_map . get ( key) {
192192 let Meta :: NameValue ( syn:: MetaNameValue { value, .. } ) = meta else {
193193 bail_span ! (
@@ -216,11 +216,11 @@ impl ItemMetaInner {
216216 Ok ( value)
217217 }
218218
219- pub fn _has_key ( & self , key : & str ) -> Result < bool > {
219+ pub ( crate ) fn _has_key ( & self , key : & str ) -> Result < bool > {
220220 Ok ( matches ! ( self . meta_map. get( key) , Some ( ( _, _) ) ) )
221221 }
222222
223- pub fn _bool ( & self , key : & str ) -> Result < bool > {
223+ pub ( crate ) fn _bool ( & self , key : & str ) -> Result < bool > {
224224 let value = if let Some ( ( _, meta) ) = self . meta_map . get ( key) {
225225 match meta {
226226 Meta :: NameValue ( syn:: MetaNameValue {
@@ -240,7 +240,7 @@ impl ItemMetaInner {
240240 Ok ( value)
241241 }
242242
243- pub fn _optional_list (
243+ pub ( crate ) fn _optional_list (
244244 & self ,
245245 key : & str ,
246246 ) -> Result < Option < impl core:: iter:: Iterator < Item = & ' _ NestedMeta > > > {
@@ -327,7 +327,7 @@ impl ItemMeta for ModuleItemMeta {
327327}
328328
329329impl ModuleItemMeta {
330- pub fn sub ( & self ) -> Result < bool > {
330+ pub ( crate ) fn sub ( & self ) -> Result < bool > {
331331 self . inner ( ) . _bool ( "sub" )
332332 }
333333}
@@ -371,7 +371,7 @@ impl ItemMeta for ClassItemMeta {
371371}
372372
373373impl ClassItemMeta {
374- pub fn class_name ( & self ) -> Result < String > {
374+ pub ( crate ) fn class_name ( & self ) -> Result < String > {
375375 const KEY : & str = "name" ;
376376 let inner = self . inner ( ) ;
377377 if let Some ( ( _, meta) ) = inner. meta_map . get ( KEY ) {
@@ -396,23 +396,23 @@ impl ClassItemMeta {
396396 )
397397 }
398398
399- pub fn ctx_name ( & self ) -> Result < Option < String > > {
399+ pub ( crate ) fn ctx_name ( & self ) -> Result < Option < String > > {
400400 self . inner ( ) . _optional_str ( "ctx" )
401401 }
402402
403- pub fn base ( & self ) -> Result < Option < syn:: Path > > {
403+ pub ( crate ) fn base ( & self ) -> Result < Option < syn:: Path > > {
404404 self . inner ( ) . _optional_path ( "base" )
405405 }
406406
407- pub fn unhashable ( & self ) -> Result < bool > {
407+ pub ( crate ) fn unhashable ( & self ) -> Result < bool > {
408408 self . inner ( ) . _bool ( "unhashable" )
409409 }
410410
411- pub fn metaclass ( & self ) -> Result < Option < String > > {
411+ pub ( crate ) fn metaclass ( & self ) -> Result < Option < String > > {
412412 self . inner ( ) . _optional_str ( "metaclass" )
413413 }
414414
415- pub fn module ( & self ) -> Result < Option < String > > {
415+ pub ( crate ) fn module ( & self ) -> Result < Option < String > > {
416416 const KEY : & str = "module" ;
417417 let inner = self . inner ( ) ;
418418 let value = if let Some ( ( _, meta) ) = inner. meta_map . get ( KEY ) {
@@ -443,7 +443,7 @@ impl ClassItemMeta {
443443 Ok ( value)
444444 }
445445
446- pub fn impl_attrs ( & self ) -> Result < Option < String > > {
446+ pub ( crate ) fn impl_attrs ( & self ) -> Result < Option < String > > {
447447 self . inner ( ) . _optional_str ( "impl" )
448448 }
449449
@@ -475,7 +475,7 @@ impl ItemMeta for ExceptionItemMeta {
475475}
476476
477477impl ExceptionItemMeta {
478- pub fn class_name ( & self ) -> Result < String > {
478+ pub ( crate ) fn class_name ( & self ) -> Result < String > {
479479 const KEY : & str = "name" ;
480480 let inner = self . inner ( ) ;
481481 if let Some ( ( _, meta) ) = inner. meta_map . get ( KEY ) {
@@ -511,7 +511,7 @@ impl ExceptionItemMeta {
511511 )
512512 }
513513
514- pub fn has_impl ( & self ) -> Result < bool > {
514+ pub ( crate ) fn has_impl ( & self ) -> Result < bool > {
515515 self . inner ( ) . _bool ( "impl" )
516516 }
517517}
0 commit comments