Skip to content

Commit 58a22cd

Browse files
committed
🔄 synced local 'docs/guide/' with remote 'docs/guide/'
1 parent e40f76e commit 58a22cd

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

‎docs/guide/cpp/field-configuration.md‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,10 @@ FORY_FIELD_CONFIG(DataV2,
527527
| **Cross-lang compat** | Limited | Limited | Full |
528528
| **Recommended for** | Simple structs | Third-party types | Complex/xlang structs |
529529

530-
## Xlang Mode Defaults
530+
## Default Values
531531

532-
C++ only supports xlang (cross-language) mode. The defaults are strict due to type system differences between languages:
533-
534-
- **Nullable**: Fields are non-nullable by default
535-
- **Ref tracking**: Disabled by default (except `std::shared_ptr` which tracks refs by default)
532+
- **Nullable**: Only `std::optional<T>` is nullable by default; all other types (including `std::shared_ptr`) are non-nullable
533+
- **Ref tracking**: Disabled by default for all types (including `std::shared_ptr`)
536534

537535
You **need to configure fields** when:
538536

‎docs/guide/go/struct-tags.md‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,18 @@ err := f.RegisterStruct(BadStruct{}, 1)
282282
// Error: ErrKindInvalidTag
283283
```
284284

285-
## Xlang Mode Defaults
285+
## Native Mode vs Xlang Mode
286286

287-
Go only supports xlang (cross-language) mode. The defaults are strict due to type system differences between languages:
287+
Field configuration behaves differently depending on the serialization mode:
288288

289-
- **Nullable**: Fields are non-nullable by default
289+
**Native Mode**:
290+
291+
- **Nullable**: Pointer, slice, map, and interface types are nullable by default
292+
- **Ref tracking**: Disabled by default (`ref` tag not set)
293+
294+
**Xlang Mode**:
295+
296+
- **Nullable**: Only pointer types are nullable by default (slices and maps are NOT nullable)
290297
- **Ref tracking**: Disabled by default (`ref` tag not set)
291298

292299
You **need to configure fields** when:

‎docs/guide/rust/field-configuration.md‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,10 @@ struct Data {
397397
}
398398
```
399399

400-
## Xlang Mode Defaults
400+
## Default Values
401401

402-
Rust only supports xlang (cross-language) mode. The defaults are strict due to type system differences between languages:
403-
404-
- **Nullable**: Fields are non-nullable by default (except `Option<T>`)
405-
- **Ref tracking**: Disabled by default (except `Rc<T>`, `Arc<T>`, weak types)
402+
- **Nullable**: `Option<T>`, `RcWeak<T>`, and `ArcWeak<T>` are nullable by default; all other types are non-nullable
403+
- **Ref tracking**: `Rc<T>`, `Arc<T>`, `RcWeak<T>`, and `ArcWeak<T>` enable ref tracking by default; all other types are disabled
406404

407405
You **need to configure fields** when:
408406

0 commit comments

Comments
 (0)