pub struct SwiftFirstClassMap {
pub first_class_types: HashSet<String>,
pub field_types: HashMap<String, HashMap<String, String>>,
pub vec_field_names: HashSet<String>,
pub root_type: Option<String>,
pub stringy_fields_by_type: HashMap<String, Vec<StringyField>>,
}Fields§
§first_class_types: HashSet<String>§field_types: HashMap<String, HashMap<String, String>>§vec_field_names: HashSet<String>§root_type: Option<String>§stringy_fields_by_type: HashMap<String, Vec<StringyField>>Per-type readable text accessors. Keyed by IR TypeDef name. Used by the
swift e2e contains assertion to aggregate every stringy field on a
Vec<T> element type into a contains(where: { ... }) closure that
does substring matching against every text-bearing accessor. Mirrors
python’s _alef_e2e_item_texts helper.
Implementations§
Source§impl SwiftFirstClassMap
impl SwiftFirstClassMap
Sourcepub fn is_first_class(&self, type_name: Option<&str>) -> bool
pub fn is_first_class(&self, type_name: Option<&str>) -> bool
Returns true when fields on type_name should be accessed as properties
(no parens), false when they should be accessed via method-call.
When type_name is None the renderer defaults to property syntax
(matching the common case where result types are first-class).
Sourcepub fn advance(
&self,
owner_type: Option<&str>,
field_name: &str,
) -> Option<String>
pub fn advance( &self, owner_type: Option<&str>, field_name: &str, ) -> Option<String>
Returns the IR Named type that field_name traverses into for the
next chain segment, or None if the field is terminal/scalar/unknown.
Sourcepub fn is_vec_field_name(&self, field_name: &str) -> bool
pub fn is_vec_field_name(&self, field_name: &str) -> bool
True when field_name appears as a Vec<T> (or Option<Vec<T>>) on
any IR type. swift codegen consults this when deciding whether .count
on a method-call accessor needs .toString() injected: RustVec already
supports .count directly; RustString does not.
Sourcepub fn stringy_fields(&self, type_name: &str) -> Option<&[StringyField]>
pub fn stringy_fields(&self, type_name: &str) -> Option<&[StringyField]>
Returns the list of stringy accessors recorded for type_name, or
None if the type has no recorded stringy fields.
Trait Implementations§
Source§impl Clone for SwiftFirstClassMap
impl Clone for SwiftFirstClassMap
Source§fn clone(&self) -> SwiftFirstClassMap
fn clone(&self) -> SwiftFirstClassMap
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more