pub enum StringyFieldKind {
Plain,
Optional,
Vec,
}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.vec_field_names— flat set of field names whose IR type isVec<T>on any owner. Used by swift_count_target to keep.countstraight on RustVec-typed method-call accessors (don’t inject.toString()).root_type— the IR type name backing the result variable.
Kind of a “stringy” field on an opaque DTO element type — used by the swift
e2e contains assertion to aggregate every readable text accessor on a
Vec<T> element instead of relying on a single primary accessor (which
often guesses wrong: e.g. ImportInfo.source is the module path but
ImportInfo.items carries the imported names).
Variants§
Plain
field_name() -> RustString (or String). Convert via .toString().
Optional
field_name() -> Optional<RustString>. Convert via ?.toString() ?? "".
Vec
field_name() -> RustVec<RustString>. Iterate elements (RustStringRef
→ .asStr().toString() on each).
Trait Implementations§
Source§impl Clone for StringyFieldKind
impl Clone for StringyFieldKind
Source§fn clone(&self) -> StringyFieldKind
fn clone(&self) -> StringyFieldKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StringyFieldKind
impl Debug for StringyFieldKind
Source§impl PartialEq for StringyFieldKind
impl PartialEq for StringyFieldKind
Source§fn eq(&self, other: &StringyFieldKind) -> bool
fn eq(&self, other: &StringyFieldKind) -> bool
self and other values to be equal, and is used by ==.impl Copy for StringyFieldKind
impl Eq for StringyFieldKind
impl StructuralPartialEq for StringyFieldKind
Auto Trait Implementations§
impl Freeze for StringyFieldKind
impl RefUnwindSafe for StringyFieldKind
impl Send for StringyFieldKind
impl Sync for StringyFieldKind
impl Unpin for StringyFieldKind
impl UnsafeUnpin for StringyFieldKind
impl UnwindSafe for StringyFieldKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.