pub struct SwiftFirstClassMap {
pub first_class_types: HashSet<String>,
pub field_types: HashMap<String, HashMap<String, String>>,
pub root_type: Option<String>,
}Expand description
Swift first-class struct classification + chain-resolution metadata.
alef-backend-swift emits two flavors of binding types:
- First-class Codable structs —
public struct Foo: Codable { public let id: String }. Fields are Swift properties; access with.id(no parens). - Opaque typealiases —
public typealias Foo = RustBridge.Foowhere the RustBridge class exposes swift-bridge methods. Fields are methods; access with.id()(parens).
The renderer needs per-segment dispatch because a path can traverse both:
e.g. BatchListResponse (first-class Codable, with data: [BatchObject]) →
indexed [0] → BatchObject (opaque typealias). At the BatchObject cursor
the renderer must switch to method-call access for .id, .status, etc.
first_class_types— set of TypeDef names whose binding is a first-class Codable struct. Membership = “use property access for fields on this type”.field_types[type_name][field_name]— the IR-resolvedNamedtype thatfield_nametraverses into.root_type— the IR type name backing the result variable.
Fields§
§first_class_types: HashSet<String>§field_types: HashMap<String, HashMap<String, String>>§root_type: Option<String>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).
Trait Implementations§
Source§impl Clone for SwiftFirstClassMap
impl Clone for SwiftFirstClassMap
Source§fn clone(&self) -> SwiftFirstClassMap
fn clone(&self) -> SwiftFirstClassMap
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SwiftFirstClassMap
impl Debug for SwiftFirstClassMap
Source§impl Default for SwiftFirstClassMap
impl Default for SwiftFirstClassMap
Source§fn default() -> SwiftFirstClassMap
fn default() -> SwiftFirstClassMap
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SwiftFirstClassMap
impl RefUnwindSafe for SwiftFirstClassMap
impl Send for SwiftFirstClassMap
impl Sync for SwiftFirstClassMap
impl Unpin for SwiftFirstClassMap
impl UnsafeUnpin for SwiftFirstClassMap
impl UnwindSafe for SwiftFirstClassMap
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