Provide the minimal pointer and opaque-handle type nodes that hosts can use
when targeting IRx's stable public FFI layer.
Classes:
OpaqueHandleType
OpaqueHandleType(handle_name: str)
Bases: AnyType
Methods:
Source code in packages/irx/src/irx/astx/ffi.py
83
84
85
86
87
88
89
90
91 | def __init__(self, handle_name: str) -> None:
"""
title: Initialize one opaque-handle type.
parameters:
handle_name:
type: str
"""
super().__init__()
self.handle_name = handle_name
|
get_struct
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/irx/src/irx/astx/ffi.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114 | def get_struct(self, simplified: bool = False) -> astx.base.ReprStruct:
"""
title: Build one repr structure for an opaque-handle type.
parameters:
simplified:
type: bool
returns:
type: astx.base.ReprStruct
"""
return self._prepare_struct(
f"OPAQUE-HANDLE[{self.handle_name}]",
self.handle_name,
simplified,
)
|
to_json
to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409 | def to_json(self, simplified: bool = False) -> str:
"""
title: Return an json string that represents the object.
parameters:
simplified:
type: bool
returns:
type: str
"""
return json.dumps(self.get_struct(simplified=simplified), indent=2)
|
to_yaml
to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398 | def to_yaml(self, simplified: bool = False) -> str:
"""
title: Return an yaml string that represents the object.
parameters:
simplified:
type: bool
returns:
type: str
"""
return str(
yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
)
|
PointerType
PointerType(pointee_type: DataType | None = None)
Bases: AnyType
Methods:
Source code in packages/irx/src/irx/astx/ffi.py
30
31
32
33
34
35
36
37
38 | def __init__(self, pointee_type: astx.DataType | None = None) -> None:
"""
title: Initialize one pointer type.
parameters:
pointee_type:
type: astx.DataType | None
"""
super().__init__()
self.pointee_type = pointee_type
|
get_struct
get_struct(simplified: bool = False) -> ReprStruct
Source code in packages/irx/src/irx/astx/ffi.py
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69 | def get_struct(self, simplified: bool = False) -> astx.base.ReprStruct:
"""
title: Build one repr structure for a pointer type.
parameters:
simplified:
type: bool
returns:
type: astx.base.ReprStruct
"""
key = "POINTER-TYPE"
value = (
None
if self.pointee_type is None
else self.pointee_type.get_struct(simplified)
)
return self._prepare_struct(
key,
cast(astx.base.ReprStruct, value),
simplified,
)
|
to_json
to_json(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
400
401
402
403
404
405
406
407
408
409 | def to_json(self, simplified: bool = False) -> str:
"""
title: Return an json string that represents the object.
parameters:
simplified:
type: bool
returns:
type: str
"""
return json.dumps(self.get_struct(simplified=simplified), indent=2)
|
to_yaml
to_yaml(simplified: bool = False) -> str
Source code in packages/astx/src/astx/base.py
387
388
389
390
391
392
393
394
395
396
397
398 | def to_yaml(self, simplified: bool = False) -> str:
"""
title: Return an yaml string that represents the object.
parameters:
simplified:
type: bool
returns:
type: str
"""
return str(
yaml.dump(self.get_struct(simplified=simplified), sort_keys=False)
)
|